Commit 06f3b3a6 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

install crash party fixes 1

parent 59e72c8c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ import (
//go:embed max_releases.json
var fallbackReleases []byte

const version = "0.6.0"
const version = "0.6.1"

const maxConfigFile = "config.xml"
const minSupportedMaxVersion = "0.0.5"
+64 −9
Original line number Diff line number Diff line
#!/bin/sh

set -u

system="$(uname -s)"
machine="$(uname -m)"
binary_url=""
@@ -19,24 +21,77 @@ case "$system/$machine" in
    ;;
esac

if [ -z "${HOME:-}" ]; then
  echo "Erreur: HOME n'est pas défini." >&2
  exit 1
fi

path_contains() {
  case ":${PATH:-}:" in
    *:"$1":*) return 0 ;;
    *) return 1 ;;
  esac
}

add_env_to_file() {
  profile="$1"
  line="$2"
  touch "$profile"
  if ! grep -qF ".climax/env" "$profile"; then
    printf '%s\n' "$line" >> "$profile"
    echo "Configuration mise à jour: $profile"
  fi
}

configure_shell() {
  shell_name="$(basename "${SHELL:-}")"
  case "$shell_name" in
    zsh)
      add_env_to_file "$HOME/.zshrc" '. "$HOME/.climax/env"'
      add_env_to_file "$HOME/.zprofile" '. "$HOME/.climax/env"'
      ;;
    bash)
      add_env_to_file "$HOME/.bashrc" '. "$HOME/.climax/env"'
      add_env_to_file "$HOME/.profile" '. "$HOME/.climax/env"'
      ;;
    *)
      echo "Shell non reconnu: ${SHELL:-inconnu}"
      echo "Ajoutez cette ligne à votre fichier de configuration shell:"
      echo '    . "$HOME/.climax/env"'
      ;;
  esac
}

echo "installation de climax..."
echo ""
if path_contains "$HOME/.local/bin"; then
  installation_path="$HOME/.local/bin"
  needs_shell_config=false
else
  installation_path="$HOME/.climax"
  needs_shell_config=true
fi
destination_bin="$installation_path/climax"
destination_env="$installation_path/env"
mkdir -p "$installation_path"
curl -o "$destination_bin" "$binary_url"
curl -o "$destination_env" https://www.certic.unicaen.fr/climax/env
curl -fL -o "$destination_bin" "$binary_url"
if [ "$clear_quarantine" = true ]; then
  xattr -c "$installation_path/climax"
  xattr -c "$destination_bin"
fi
chmod 750 "$destination_bin"
if [ "$needs_shell_config" = true ]; then
  destination_env="$installation_path/env"
  curl -fL -o "$destination_env" https://www.certic.unicaen.fr/climax/env
  configure_shell
fi
chmod 750 "$installation_path/climax"
grep -qF ".climax/env" ~/.zprofile || echo 'source "$HOME/.climax/env"' >> ~/.zprofile
grep -qF ".climax/env" ~/.profile || echo '. "$HOME/.climax/env"' >> ~/.profile
echo ""
echo "Installation ok."
echo ""
echo "Pour tester votre installation:"
echo "    - relancez votre shell"
if [ "$needs_shell_config" = true ]; then
  echo '    - lancez: . "$HOME/.climax/env"'
  echo "      ou relancez votre shell"
else
  echo "    - ouvrez un nouveau shell si votre session ne voit pas encore $installation_path"
fi
echo "    - lancez climax --help"
echo ""
+64 −9
Original line number Diff line number Diff line
#!/bin/sh

set -u

if [ "$(uname -s)" != "Linux" ] || [ "$(uname -m)" != "x86_64" ]; then
  echo "Erreur: ce script installe climax pour Linux 64 bits uniquement." >&2
  exit 1
fi

if [ -z "${HOME:-}" ]; then
  echo "Erreur: HOME n'est pas défini." >&2
  exit 1
fi

path_contains() {
  case ":${PATH:-}:" in
    *:"$1":*) return 0 ;;
    *) return 1 ;;
  esac
}

add_env_to_file() {
  profile="$1"
  line="$2"
  touch "$profile"
  if ! grep -qF ".climax/env" "$profile"; then
    printf '%s\n' "$line" >> "$profile"
    echo "Configuration mise à jour: $profile"
  fi
}

configure_shell() {
  shell_name="$(basename "${SHELL:-}")"
  case "$shell_name" in
    zsh)
      add_env_to_file "$HOME/.zshrc" '. "$HOME/.climax/env"'
      add_env_to_file "$HOME/.zprofile" '. "$HOME/.climax/env"'
      ;;
    bash)
      add_env_to_file "$HOME/.bashrc" '. "$HOME/.climax/env"'
      add_env_to_file "$HOME/.profile" '. "$HOME/.climax/env"'
      ;;
    *)
      echo "Shell non reconnu: ${SHELL:-inconnu}"
      echo "Ajoutez cette ligne à votre fichier de configuration shell:"
      echo '    . "$HOME/.climax/env"'
      ;;
  esac
}

echo "installation de climax..."
echo ""
if path_contains "$HOME/.local/bin"; then
  installation_path="$HOME/.local/bin"
  needs_shell_config=false
else
  installation_path="$HOME/.climax"
  needs_shell_config=true
fi
destination_bin="$installation_path/climax"
mkdir -p "$installation_path"
curl -fL -o "$destination_bin" https://www.certic.unicaen.fr/climax/climax-linux-amd64
chmod 750 "$destination_bin"
if [ "$needs_shell_config" = true ]; then
  destination_env="$installation_path/env"
mkdir -p $installation_path
curl -o $destination_bin  https://www.certic.unicaen.fr/climax/climax-linux-amd64
curl -o $destination_env  https://www.certic.unicaen.fr/climax/env
chmod 750 "$installation_path/climax"
grep -qF ".climax/env" ~/.zprofile || echo 'source "$HOME/.climax/env"' >> ~/.zprofile
grep -qF ".climax/env" ~/.profile || echo '. "$HOME/.climax/env"' >> ~/.profile
  curl -fL -o "$destination_env" https://www.certic.unicaen.fr/climax/env
  configure_shell
fi
echo ""
echo "Installation ok."
echo ""
echo "Pour tester votre installation:"
echo "    - relancez votre shell"
if [ "$needs_shell_config" = true ]; then
  echo '    - lancez: . "$HOME/.climax/env"'
  echo "      ou relancez votre shell"
else
  echo "    - ouvrez un nouveau shell si votre session ne voit pas encore $installation_path"
fi
echo "    - lancez climax --help"
echo ""
+65 −10
Original line number Diff line number Diff line
#!/bin/sh

set -u

if [ "$(uname -s)" != "Darwin" ] || [ "$(uname -m)" != "arm64" ]; then
  echo "Erreur: ce script installe climax pour macOS Apple Silicon uniquement." >&2
  exit 1
fi

if [ -z "${HOME:-}" ]; then
  echo "Erreur: HOME n'est pas défini." >&2
  exit 1
fi

path_contains() {
  case ":${PATH:-}:" in
    *:"$1":*) return 0 ;;
    *) return 1 ;;
  esac
}

add_env_to_file() {
  profile="$1"
  line="$2"
  touch "$profile"
  if ! grep -qF ".climax/env" "$profile"; then
    printf '%s\n' "$line" >> "$profile"
    echo "Configuration mise à jour: $profile"
  fi
}

configure_shell() {
  shell_name="$(basename "${SHELL:-}")"
  case "$shell_name" in
    zsh)
      add_env_to_file "$HOME/.zshrc" '. "$HOME/.climax/env"'
      add_env_to_file "$HOME/.zprofile" '. "$HOME/.climax/env"'
      ;;
    bash)
      add_env_to_file "$HOME/.bashrc" '. "$HOME/.climax/env"'
      add_env_to_file "$HOME/.profile" '. "$HOME/.climax/env"'
      ;;
    *)
      echo "Shell non reconnu: ${SHELL:-inconnu}"
      echo "Ajoutez cette ligne à votre fichier de configuration shell:"
      echo '    . "$HOME/.climax/env"'
      ;;
  esac
}

echo "installation de climax..."
echo ""
if path_contains "$HOME/.local/bin"; then
  installation_path="$HOME/.local/bin"
  needs_shell_config=false
else
  installation_path="$HOME/.climax"
  needs_shell_config=true
fi
destination_bin="$installation_path/climax"
mkdir -p "$installation_path"
curl -fL -o "$destination_bin" https://www.certic.unicaen.fr/climax/climax-darwin-arm64
xattr -c "$destination_bin"
chmod 750 "$destination_bin"
if [ "$needs_shell_config" = true ]; then
  destination_env="$installation_path/env"
mkdir -p $installation_path
curl -o $destination_bin  https://www.certic.unicaen.fr/climax/climax-darwin-arm64
curl -o $destination_env  https://www.certic.unicaen.fr/climax/env
xattr -c "$installation_path/climax"
chmod 750 "$installation_path/climax"
grep -qF ".climax/env" ~/.zprofile || echo 'source "$HOME/.climax/env"' >> ~/.zprofile
grep -qF ".climax/env" ~/.profile || echo '. "$HOME/.climax/env"' >> ~/.profile
  curl -fL -o "$destination_env" https://www.certic.unicaen.fr/climax/env
  configure_shell
fi
echo ""
echo "Installation ok."
echo ""
echo "Pour tester votre installation:"
echo "    - relancez votre shell"
if [ "$needs_shell_config" = true ]; then
  echo '    - lancez: . "$HOME/.climax/env"'
  echo "      ou relancez votre shell"
else
  echo "    - ouvrez un nouveau shell si votre session ne voit pas encore $installation_path"
fi
echo "    - lancez climax --help"
echo ""
+0 −1
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ func syncBundles(rootDirectory string) error {
			return err
		}
		if isVocabulary && bundleName != vocabularyBundle {
			fmt.Println(T("msg.vocabulary_ignored", bundleName))
			_ = touchFile(filepath.Join(bundleDir, ignoreFile))
		}