@upstatement/twix 0.1.1 → 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.
Files changed (2) hide show
  1. package/bin/twix +18 -7
  2. package/package.json +5 -5
package/bin/twix CHANGED
@@ -1,12 +1,23 @@
1
1
  #!/bin/sh
2
- # basedir is the bin/ directory inside @upstatement/twix
3
- # We need to go up two levels to @upstatement/, then into the platform package
4
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
2
+ # Resolve the real path of this script (following symlinks)
3
+ # This is needed because npm creates a symlink in node_modules/.bin/
4
+ SCRIPT="$0"
5
+ while [ -h "$SCRIPT" ]; do
6
+ SCRIPTDIR="$(cd -P "$(dirname "$SCRIPT")" && pwd)"
7
+ SCRIPT="$(readlink "$SCRIPT")"
8
+ case "$SCRIPT" in
9
+ /*) ;;
10
+ *) SCRIPT="$SCRIPTDIR/$SCRIPT" ;;
11
+ esac
12
+ done
13
+ SCRIPTDIR="$(cd -P "$(dirname "$SCRIPT")" && pwd)"
5
14
 
15
+ # SCRIPTDIR is now the real bin/ directory inside @upstatement/twix
16
+ # Go up two levels to @upstatement/, then into the platform package
6
17
  case "$(uname -s)-$(uname -m)" in
7
- Darwin-arm64) exec "$basedir/../../twix-darwin-arm64/bin/twix" "$@" ;;
8
- Darwin-x86_64) exec "$basedir/../../twix-darwin-x64/bin/twix" "$@" ;;
9
- Linux-aarch64) exec "$basedir/../../twix-linux-arm64/bin/twix" "$@" ;;
10
- Linux-x86_64) exec "$basedir/../../twix-linux-x64/bin/twix" "$@" ;;
18
+ Darwin-arm64) exec "$SCRIPTDIR/../../twix-darwin-arm64/bin/twix" "$@" ;;
19
+ Darwin-x86_64) exec "$SCRIPTDIR/../../twix-darwin-x64/bin/twix" "$@" ;;
20
+ Linux-aarch64) exec "$SCRIPTDIR/../../twix-linux-arm64/bin/twix" "$@" ;;
21
+ Linux-x86_64) exec "$SCRIPTDIR/../../twix-linux-x64/bin/twix" "$@" ;;
11
22
  *) echo "Unsupported platform: $(uname -s)-$(uname -m)" >&2; exit 1 ;;
12
23
  esac
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@upstatement/twix",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A formatter for Twig templates with HTML",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/Upstatement/twix.git"
8
8
  },
9
9
  "optionalDependencies": {
10
- "@upstatement/twix-darwin-arm64": "0.1.1",
11
- "@upstatement/twix-darwin-x64": "0.1.1",
12
- "@upstatement/twix-linux-arm64": "0.1.1",
13
- "@upstatement/twix-linux-x64": "0.1.1"
10
+ "@upstatement/twix-darwin-arm64": "0.1.2",
11
+ "@upstatement/twix-darwin-x64": "0.1.2",
12
+ "@upstatement/twix-linux-arm64": "0.1.2",
13
+ "@upstatement/twix-linux-x64": "0.1.2"
14
14
  },
15
15
  "keywords": [
16
16
  "twig",