-
Notifications
You must be signed in to change notification settings - Fork 55
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
f7daed6
commit 314b872
Showing
3 changed files
with
64 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Put `goosey` in your $PATH if you want to launch via: | ||
|
||
`goosey .` | ||
|
||
Will open goose GUI from any path you specify |
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,41 @@ | ||
#!/bin/bash | ||
|
||
# Get the absolute path of the current directory | ||
current_dir="$(pwd)" | ||
|
||
# If an argument is provided, use it as the directory | ||
if [ $# -gt 0 ]; then | ||
# Handle tilde expansion and relative paths | ||
if [[ "$1" == "~"* ]]; then | ||
# Replace ~ with $HOME | ||
dir="${1/#\~/$HOME}" | ||
elif [[ "$1" == "." ]]; then | ||
# Use absolute path as is | ||
dir="$current_dir" | ||
elif [[ "$1" == "."* ]]; then | ||
# Convert relative path to absolute | ||
dir="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" | ||
else | ||
# Convert relative path to absolute | ||
dir="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" | ||
fi | ||
else | ||
# Use current directory if no argument provided | ||
dir="$current_dir" | ||
fi | ||
|
||
echo $dir | ||
|
||
# On macOS, use the .app bundle | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# Assuming Goose.app is installed in /Applications | ||
if [ -d "/Applications/Goose.app" ]; then | ||
/Applications/Goose.app/Contents/MacOS/Goose --args --dir "$dir" | ||
else | ||
echo "Error: Goose.app not found in /Applications" | ||
exit 1 | ||
fi | ||
else | ||
# For Linux, assuming the binary is installed in the PATH | ||
goose-app --dir "$dir" | ||
fi |
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