Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CLI #63

Merged
merged 13 commits into from
Jul 3, 2023
Merged

Refactor CLI #63

merged 13 commits into from
Jul 3, 2023

Conversation

jlesquembre
Copy link
Owner

@jlesquembre jlesquembre commented Jul 2, 2023

Split CLI in 2 binaries, deps-lock (public) and clj-builder (internal)

deps-lock now has more options, to include/exclude files/aliases and to support bb.edn files. Initial work was done at #54

@bendlas I renamed the --ignore-alias to --exclude-alias

Closes #37 #53

@jlesquembre jlesquembre linked an issue Jul 2, 2023 that may be closed by this pull request
Copy link
Contributor

@bendlas bendlas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like. Tried it out and works for my use case.

args)))

(= flag "--check-main")
(check-main-class args))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For non-optional, positional arguments like this, probably a non -- form would be more common, like <cmd> jar , ...

But since these flags are not public API, it doesn't really matter, right?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if the flags are private, makes sense to be consistent, I'm changing it.

README.md Outdated
nix run github:jlesquembre/clj-nix#deps-lock -- --exclude-alias test
```

There is also a `--include-alias` option, to include only certain aliases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implemented options are the other way round from what's documented here:

Unknown option: :exclude-alias

deps-lock usage:

  --deps-include  List of 'deps.edn' files to parse. All files are included by default.
  --deps-exclude  List of 'deps.edn' files to exclude.
  --alias-include List of aliases to include. All aliases are included by default.
  --alias-exclude List of aliases to exclude.
  --bb            Include dependencies in bb.edn files.
  --lein          Include Leiningen dependecies.
  --help          Print help and exit.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Good catch, thanks!

:escape-js-separators false)]
(->> (sh/sh "jq" "-n" "--argjson" "data" lock-str "$data")
:out
(spit "deps-lock.json")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if a flake.lock isn't on the git index, it is directly git add ed when it's generated, so that it can be picked up right away. maybe it would be worth doing the same here, to avoid confusion?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'm doing that.

@jlesquembre
Copy link
Owner Author

@bendlas thanks for taking time to review it, useful suggestions. I'm adding some commits to address your feedback

@jlesquembre jlesquembre merged commit 354f0f2 into main Jul 3, 2023
@jlesquembre jlesquembre deleted the new-cli branch July 3, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor CLI to be more granular Support Babashka
2 participants