Closed clemensv closed 1 week ago
Great job @clemensv, do you update the readme? Thanks a lot!
Sure. I'll update the README.md in next couple of hours.
@marcomaroni-github README has been added. Please review and try it out before merging.
@clemensv I have tried this command line
npm run start -- -- --archive-folder C:/Temp/twitter-archive-2024-04-08 --bluesky-username bsky-bot-test.bsky.social --bluesky-password 123 --twitter-handles marcomaroni --min-date '2023-08-27T03:12:49.393Z' --max-date '2023-08-28T03:12:49.393Z' --simulate
but it responds with:
Missing required arguments: archive-folder, bluesky-username, bluesky-password
@clemensv I have tried this command line
npm run start -- -- --archive-folder C:/Temp/twitter-archive-2024-04-08 --bluesky-username bsky-bot-test.bsky.social --bluesky-password 123 --twitter-handles marcomaroni --min-date '2023-08-27T03:12:49.393Z' --max-date '2023-08-28T03:12:49.393Z' --simulate
Does node app.js --archive-folder C:/Temp/twitter-archive-2024-04-08 --bluesky-username bsky-bot-test.bsky.social --bluesky-password 123 --twitter-handles marcomaroni --min-date '2023-08-27T03:12:49.393Z' --max-date '2023-08-28T03:12:49.393Z' --simulate
work for you?
I'm on Node 22
Does
node app.js --archive-folder C:/Temp/twitter-archive-2024-04-08 --bluesky-username bsky-bot-test.bsky.social --bluesky-password 123 --twitter-handles marcomaroni --min-date '2023-08-27T03:12:49.393Z' --max-date '2023-08-28T03:12:49.393Z' --simulate
work for you?
Yes, calling node directly it works, and I'm on node 20.12.1
Then it's some change in behavior in npm, I assume
I updated npm to 10.9 (I had 10.5) and now it works!
Are you going to merge it?
I have the same issue (missing required arguments) and on Sequoia, with npm@10.9.1 and node.js v23.2.0 I tried with the command line and with a .env file, same result
This PR consolidates the existing evaluation of environment variables into main() and introduces parameters into the utility functions where the environment is currently referenced directly.
The main() function uses yargs to parse parameters off the command line, with default values taken from the existing environment parameters. The app should thus run as before when using the .env file or explicitly set environment variables.
when using "npm start", the parameters must be passed by two (!) sets of double-dashes, e.g.
npm start -- -- npm run start -- -- --twitter-handles clemensv --bluesky-username clemens-archive.vasters.com --archive-folder m:\twitter --bluesky-password ********** --min-date 2015-08-21
That's a "feature" of npm, not of the script.
This is in prep for bundling the app into a self-contained executable.