@trendify/cli 0.1.32 → 0.1.34

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/trendify.sh +23 -1
  2. package/package.json +1 -1
package/bin/trendify.sh CHANGED
@@ -1,7 +1,29 @@
1
1
  #!/bin/sh
2
2
  set -eu
3
3
 
4
- SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
4
+ resolve_script_path() {
5
+ TARGET_PATH=$1
6
+
7
+ while [ -L "$TARGET_PATH" ]; do
8
+ LINK_TARGET=$(readlink "$TARGET_PATH")
9
+
10
+ case "$LINK_TARGET" in
11
+ /*)
12
+ TARGET_PATH=$LINK_TARGET
13
+ ;;
14
+ *)
15
+ TARGET_DIR=$(CDPATH= cd -- "$(dirname -- "$TARGET_PATH")" && pwd)
16
+ TARGET_PATH="$TARGET_DIR/$LINK_TARGET"
17
+ ;;
18
+ esac
19
+ done
20
+
21
+ TARGET_DIR=$(CDPATH= cd -- "$(dirname -- "$TARGET_PATH")" && pwd -P)
22
+ printf '%s/%s\n' "$TARGET_DIR" "$(basename -- "$TARGET_PATH")"
23
+ }
24
+
25
+ SCRIPT_PATH=$(resolve_script_path "$0")
26
+ SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$SCRIPT_PATH")" && pwd -P)
5
27
  PACKAGE_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
6
28
  UPDATE_EXIT_CODE=42
7
29
  STATE_FILE_DEFAULT="${HOME}/.trendify/runtime/update-state.env"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trendify/cli",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "CLI do Trendify para descoberta de temas e fluxos de conta.",
5
5
  "type": "module",
6
6
  "main": "dist/cli.entry.js",