-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f4937e
commit c5fd2a6
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Find the 'topos-cli' directory | ||
TOPOS_CLI_DIR=$(find "$HOME" -type d -name "topos-cli" -print -quit 2>/dev/null) | ||
|
||
if [ -z "$TOPOS_CLI_DIR" ]; then | ||
echo "Error: 'topos-cli' directory not found" | ||
exit 1 | ||
fi | ||
|
||
# Switch to the 'topos-cli' directory | ||
cd "$TOPOS_CLI_DIR" | ||
|
||
# Open a new Terminal window and run nix-shell | ||
# Force install nix on user's system: https://github.com/DeterminateSystems/nix-installer | ||
osascript <<EOF | ||
tell application "Terminal" | ||
do script "cd '$TOPOS_CLI_DIR' && \ | ||
if ! command -v nix &> /dev/null && [ ! -d /nix ] && [ ! -f ~/.nix-profile/etc/profile.d/nix.sh ] && [ ! -d ~/.nix-profile ]; then \ | ||
echo 'Nix is not installed. Installing Nix...'; \ | ||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm; \ | ||
if [ -f ~/.nix-profile/etc/profile.d/nix.sh ]; then \ | ||
source ~/.nix-profile/etc/profile.d/nix.sh; \ | ||
else \ | ||
echo 'Error: Nix profile script not found. Please check the installation.'; \ | ||
exit 1; \ | ||
fi; \ | ||
echo 'Nix installation complete.'; \ | ||
else \ | ||
echo 'Nix is already installed.'; \ | ||
fi && nix-shell" | ||
end tell | ||
EOF |