Profpatsch / yarn2nix

Build and deploy node packages with nix from yarn.lock files.
MIT License
85 stars 21 forks source link

feat(yarn2nix): add --offline flag to abort if network is needed #39

Closed sternenseemann closed 4 years ago

sternenseemann commented 4 years ago

Example output for CodiMD/server's yarn.lock:

./result/bin/yarn2nix --offline ~/tmp/server/yarn.lock
Refusing to resolve "git+https://github.com/shawnmclean/Idle.js#db9beb3483a460ad638ec947867720f0ed066a62" because --offline is set
Refusing to resolve "git+https://github.com/hackmdio/CodeMirror.git#2ac9b9f25707606b0c09b99decaf9d08dd434570" because --offline is set
Refusing to resolve "git+https://github.com/hackmdio/diff-match-patch.git#5b73bb82454a81ecdbdb81afb4bea4c36132fbaa" because --offline is set
Refusing to resolve "git+https://github.com/hackmdio/node-imgur.git#4fe9cfa3893505c34c49067483d85d3ad4376cd6" because --offline is set
Refusing to resolve "git+https://github.com/codimd/js-sequence-diagrams.git#b9afa038521e5dadf9b97624a3c7db21890be669" because --offline is set
Refusing to resolve "git+https://github.com/hackmdio/lz-string.git#efd1f64676264d6d8871b01f4f375fc6ef4f9022" because --offline is set
Refusing to resolve "git+https://github.com/codimd/meta-marked#a7b45a287465f79656134ff7142d1d74c8fcacfd" because --offline is set
Refusing to resolve "git+https://github.com/dmitrybaranovskiy/raphael#d8fbe4be81d362837f95e33886b80fb41de443b4" because --offline is set
Profpatsch commented 4 years ago

What can I say, awesum.

sternenseemann commented 4 years ago

Eventually we should refactor the option parsing in cli, I fear adding the next option with the current “parsing” will be quite annoying.

Profpatsch commented 4 years ago

Yeah, I want to switch to subcommands at some point. Probably while keeping the current CLI as aliases (but undocumented and with a warning).

sternenseemann commented 4 years ago

Probably the best option, it even currently has subcommands already: