satoridb 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/add-to-path.sh CHANGED
@@ -1,25 +1,34 @@
1
1
  #!/bin/bash
2
2
 
3
3
  SATORI_PATH="$HOME/.satori/bin"
4
- PROFILE_FILES=("$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.profile")
5
-
6
- # Línea que añadiremos si no está
7
4
  EXPORT_LINE='export PATH="$HOME/.satori/bin:$PATH"'
8
5
 
9
- already_exists=false
10
-
11
- for profile in "${PROFILE_FILES[@]}"; do
12
- if [[ -f "$profile" ]] && grep -qF "$EXPORT_LINE" "$profile"; then
13
- echo "ℹ️ Ya existe PATH en $profile"
14
- already_exists=true
15
- break
6
+ # Detectar shell y archivo de configuración
7
+ detect_profile() {
8
+ if [ -n "$ZSH_VERSION" ]; then
9
+ echo "$HOME/.zshrc"
10
+ elif [ -n "$BASH_VERSION" ]; then
11
+ if [[ "$OSTYPE" == "darwin"* ]]; then
12
+ echo "$HOME/.bash_profile"
13
+ else
14
+ echo "$HOME/.bashrc"
15
+ fi
16
+ elif [ -n "$FISH_VERSION" ]; then
17
+ echo "$HOME/.config/fish/config.fish"
18
+ else
19
+ # Fallback general
20
+ echo "$HOME/.profile"
16
21
  fi
17
- done
22
+ }
18
23
 
19
- if ! $already_exists; then
20
- echo "✅ Añadiendo al PATH en ${PROFILE_FILES[0]}"
21
- echo -e "\n# Añadido por Satori\n$EXPORT_LINE" >> "${PROFILE_FILES[0]}"
22
- echo "🔄 Ejecuta: source ${PROFILE_FILES[0]}"
23
- else
24
+ PROFILE_FILE=$(detect_profile)
25
+
26
+ # Verificar si ya existe la línea
27
+ if [[ -f "$PROFILE_FILE" ]] && grep -qF "$EXPORT_LINE" "$PROFILE_FILE"; then
28
+ echo "ℹ️ Ya existe PATH en $PROFILE_FILE"
24
29
  echo "✅ PATH ya contiene ~/.satori/bin"
25
- fi
30
+ else
31
+ echo "✅ Añadiendo al PATH en $PROFILE_FILE"
32
+ echo -e "\n# Añadido por Satori\n$EXPORT_LINE" >> "$PROFILE_FILE"
33
+ echo "🔄 Ejecuta: source $PROFILE_FILE"
34
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "satoridb",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Install satori",
5
5
  "bin" : {
6
6
  "satori" : "./cli.js"
package/postinstall.js CHANGED
@@ -13,17 +13,18 @@ const baseURL = "https://www.satoridb.com";
13
13
  let fileName;
14
14
 
15
15
  if (platform === "linux") fileName = "lin/satori-linux.zip";
16
- else if (platform === "darwin") fileName = "mac/satori-mac.zip";
16
+ else if (platform === "darwin") fileName = "mac/satori-mac-universal.zip"; // <- ZIP universal
17
17
  else if (platform === "win32") fileName = "win/satori-win.zip";
18
18
  else {
19
19
  console.log("❌ Not supported platform:", platform);
20
20
  process.exit(1);
21
21
  }
22
22
 
23
+ const binName = platform === "win32" ? "satori.exe" : "satori";
24
+
23
25
  const tmpDir = path.join(os.tmpdir(), "satori-temp");
24
26
  const zipPath = path.join(tmpDir, fileName);
25
27
  const installDir = path.join(os.homedir(), ".satori", "bin");
26
- const binName = platform === "win32" ? "satori.exe" : "satori";
27
28
  const binFullPath = path.join(installDir, binName);
28
29
 
29
30