guess-js-deps-bash 0.1.64 → 0.1.65

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/guess-js-deps.sh +9 -3
  2. package/package.json +1 -1
package/guess-js-deps.sh CHANGED
@@ -69,7 +69,11 @@ function parse_cli_opts () {
69
69
  #case "${CFG[no-more-opts]}$OPT" in
70
70
  case "$OPT" in
71
71
  '' ) continue;;
72
- '..' | '../'* ) cd -- "$OPT";; # probably to where your package.json is.
72
+
73
+ # Options to cd to where probably your package.json is:
74
+ '..' | '../'* ) cd -- "$OPT" || return $?;;
75
+ // ) cd -- "$(git rev-parse --show-toplevel)" || return $?;;
76
+
73
77
  -- ) POS_ARGS+=( "$@" ); break;;
74
78
  #-- ) CFG[no-more-opts]='%%--'; continue;;
75
79
  --expect-no-changes | \
@@ -172,7 +176,7 @@ function init_resolve_cache__webpack_cfg () {
172
176
  function init_resolve_cache__forced_custom () {
173
177
  local LIST=()
174
178
  readarray -t LIST < <(
175
- nodejs -p 'var manif = require("./package.json"); JSON.stringify([
179
+ nodejs -p 'var manif = require("./'"$MANI_BFN"'"); JSON.stringify([
176
180
  manif.dependencies,
177
181
  manif.devDependencies,
178
182
  ], null, 2)' | sed -nrf <(echo '
@@ -231,6 +235,8 @@ function find_webpack_config_cached_deps () {
231
235
 
232
236
  function find_imports_in_project () {
233
237
  local THEN=( "$@" )
238
+ [ -f "$MANI_BFN" ] || return 4$(
239
+ echo "E: Flinch: Found no $MANI_BFN in $PWD." >&2)
234
240
  local CWD_PKG_NAME="$(guess_cwd_pkg_name)"
235
241
  local -A DEPS_BY_TYPE=()
236
242
  eval "$(init_resolve_cache)"
@@ -595,7 +601,7 @@ function node_resolve__manif () {
595
601
  * ) return 2;;
596
602
  esac
597
603
  local NDEF=$'^\n\nError [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath '$(
598
- )"'./package.json'"' is not defined by "exports" in '
604
+ )"'./$MANI_BFN'"' is not defined by "exports" in '
599
605
  local FOUND=
600
606
  case "$BUF" in
601
607
  *"$NDEF"*$'\n at '* )
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  { "name": "guess-js-deps-bash",
2
- "version": "0.1.64",
2
+ "version": "0.1.65",
3
3
  "description": "A bash attempt at npm-forgot: Guess JavaScript require() dependencies, detect their versions, compare with package.json.",
4
4
 
5
5
  "keywords": [