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 +26 -17
- package/package.json +1 -1
- package/postinstall.js +3 -2
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
22
|
+
}
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
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
|
|