omnimem 0.1.0 → 0.1.2
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/omnimem +11 -1
- package/package.json +1 -1
package/bin/omnimem
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
# Resolve symlinked launchers (e.g. node_modules/.bin/omnimem -> ../omnimem/bin/omnimem)
|
|
5
|
+
# so npx can always locate the packaged Python module.
|
|
6
|
+
SOURCE="${BASH_SOURCE[0]}"
|
|
7
|
+
while [[ -h "$SOURCE" ]]; do
|
|
8
|
+
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
9
|
+
SOURCE="$(readlink "$SOURCE")"
|
|
10
|
+
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE"
|
|
11
|
+
done
|
|
12
|
+
SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
13
|
+
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
14
|
+
|
|
5
15
|
PYTHONPATH="$ROOT_DIR${PYTHONPATH:+:$PYTHONPATH}" exec python3 -m omnimem.cli "$@"
|