@raycast/api 1.39.0 → 1.39.1
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/bin/ray +12 -6
- package/package.json +1 -1
package/bin/ray
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
3
|
# Determine the path for dist folder
|
|
4
|
-
# Using readlink -f
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
# Using 'readlink -f' is not an option as '-f' it's not available on older macOS versions
|
|
5
|
+
source=${BASH_SOURCE:-$0}
|
|
6
|
+
# resolve $source until the file is no longer a symlink
|
|
7
|
+
while [ -L "$source" ]; do
|
|
8
|
+
dir=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )
|
|
9
|
+
source=$(readlink "$source")
|
|
10
|
+
# if $source was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
|
11
|
+
[[ $source != /* ]] && source=$dir/$source
|
|
12
|
+
done
|
|
13
|
+
bin_dir=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )
|
|
7
14
|
dist_dir=$(dirname $bin_dir)
|
|
15
|
+
|
|
8
16
|
if [ -z "$bin_dir" ]; then
|
|
9
|
-
echo "Unable to determine CLI path
|
|
17
|
+
echo "Unable to determine CLI path for source: ${BASH_SOURCE:-$0}"
|
|
10
18
|
exit 1
|
|
11
19
|
fi
|
|
12
20
|
|
|
@@ -54,6 +62,4 @@ if [ "$1" == "npm-post-install" ]; then
|
|
|
54
62
|
fi
|
|
55
63
|
|
|
56
64
|
# Execute the CLI passing all parameters to it
|
|
57
|
-
file /usr/local
|
|
58
|
-
|
|
59
65
|
$ray_path "$@"
|