Skip to content

Commit

Permalink
Ignore --require for adb program
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 27, 2023
1 parent a21beb5 commit 4afe6db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/binaries/resolvers/fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ type ArgResolvers = Record<string, ArgResolver>;

const withPositional: ArgResolver = parsed => [parsed._[0], parsed.require].flat();
const withoutPositional: ArgResolver = parsed => [parsed.require].flat();
const withoutRequire: ArgResolver = () => [];

const argFilters: ArgResolvers = {
adb: withoutRequire,
'babel-node': withPositional,
esbuild: withPositional,
execa: withPositional,
Expand Down
6 changes: 5 additions & 1 deletion test/util/getReferencesFromScripts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,16 @@ test('getReferencesFromScripts (c8)', () => {
t('c8 --reporter=lcov --reporter text node --test --test-reporter=@org/reporter', ['bin:c8', '@org/reporter']);
});

test('getReferencesFromScripts (nodemon', () => {
test('getReferencesFromScripts (nodemon)', () => {
t('nodemon --require dotenv/config ./script.js --watch ./script.js', ['bin:nodemon', js, 'dotenv']);
t("nodemon --exec 'ts-node --esm' ./main.ts | pino-pretty", ['bin:nodemon', ts, 'bin:ts-node', 'bin:pino-pretty']);
t('nodemon script.js', ['bin:nodemon', js]);
});

test('getReferencesFromScripts (fallback resolver)', () => {
t('adb install -r android/app/app-dev-debug.apk', ['bin:adb']);
});

test('getReferencesFromScripts (bash expressions)', () => {
t('if test "$NODE_ENV" = "production" ; then make install ; fi ', ['bin:make']);
t('node -e "if (NODE_ENV === \'production\'){process.exit(1)} " || make install', ['bin:make']);
Expand Down

0 comments on commit 4afe6db

Please sign in to comment.