-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a helper module to install Nushell dependencies (#66)
might help for things like #64
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const NUSHELL_REMOTE = "https://github.com/nushell/nushell" | ||
const PKGS = [ "nuon", "nu-protocol", "nu-plugin" ] | ||
|
||
# setup Nushell dependencies | ||
# | ||
# > **Note** | ||
# > options are shown in inverse order of precedence | ||
export def main [ | ||
--rev: string, # a Nushell revision | ||
--tag: string, # a Nushell tag | ||
--current, # use the current Nushell version | ||
] { | ||
let opts = if $current { | ||
if (version).commit_hash != null { | ||
print $"using current revision of Nushell: (version | get commit_hash)" | ||
[ --rev (version).commit_hash ] | ||
} else { | ||
print $"using current version of Nushell: (version | get version)" | ||
[ --tag (version).version ] | ||
} | ||
} else { | ||
if $tag != null { | ||
print $"using user version: ($tag)" | ||
[ --tag $tag ] | ||
} else if $rev != null { | ||
print $"using user revision: ($rev)" | ||
[ --rev $rev ] | ||
} else { | ||
error make --unspanned { msg: "please give either `--rev` or `--tag`" } | ||
} | ||
} | ||
|
||
for pkg in $PKGS { | ||
cargo add $pkg --git $NUSHELL_REMOTE ...$opts | ||
} | ||
} |