Twaha-Rahman/e-commercify

[BUG] Injection script doesn't take note of flags passed

Closed this issue ยท 3 comments

Describe the bug

The sample data injection script currently doesn't take note of the flags passed.

To Reproduce
How can we reproduce this bug?

  1. Run npm run fill-db -k
  2. Observe the issue

Expected behavior

The sample data injection script should take note of the flags passed.

Screenshots

Screenshot (2)

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.98. Please mark this comment with ๐Ÿ‘ or ๐Ÿ‘Ž to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

So I did a little digging.
If you're calling the script via the npm run command, you have to separate the script name from the args.
npm run fill-db -k won't pass any arguments to the script. npm run fill-db -- -k will pass the -k argument to the script.

I tested this with both npm run fill-db -- -k and npm run fill-db -- --keep and both behaved as intended.

So I did a little digging.
If you're calling the script via the npm run command, you have to separate the script name from the args.
npm run fill-db -k won't pass any arguments to the script. npm run fill-db -- -k will pass the -k argument to the script.

I tested this with both npm run fill-db -- -k and npm run fill-db -- --keep and both behaved as intended.

Ahhh... I see. Closing this issue then.