Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
feat: add shorthands for lake script run/list
Browse files Browse the repository at this point in the history
closes #88
  • Loading branch information
tydeu committed Jul 9, 2022
1 parent 505104c commit 080cda1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Lake/CLI/Help.lean
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ COMMANDS:
update update dependencies
clean remove build outputs
script manage and run workspace scripts
scripts shorthand for `lake script list`
run <script> shorthand for `lake script run`
serve start the Lean language server
env <cmd> [<args>...] execute a command in the workspace's environment
Expand Down Expand Up @@ -196,6 +198,8 @@ def help : (cmd : String) → String
| "update" => helpUpdate
| "clean" => helpClean
| "script" => helpScriptCli
| "scripts" => helpScriptList
| "run" => helpScriptRun
| "serve" => helpServe
| "env" => helpEnv
| _ => usage
2 changes: 2 additions & 0 deletions Lake/CLI/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ def lakeCli : (cmd : String) → CliM PUnit
| "print-paths" => lake.printPaths
| "clean" => lake.clean
| "script" => lake.script
| "scripts" => lake.script.list
| "run" => lake.script.run
| "serve" => lake.serve
| "env" => lake.env
| "self-check" => lake.selfCheck
Expand Down
14 changes: 8 additions & 6 deletions examples/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
set -ex
${LAKE:-../../build/bin/lake} script list
${LAKE:-../../build/bin/lake} script run scripts/greet
${LAKE:-../../build/bin/lake} script run greet me
${LAKE:-../../build/bin/lake} script doc greet
${LAKE:-../../build/bin/lake} script run nonexistant && false || true
${LAKE:-../../build/bin/lake} script doc nonexistant && false || true
LAKE=${LAKE:-../../build/bin/lake}
$LAKE script list
$LAKE run scripts/greet
$LAKE script run greet me
$LAKE script doc greet
$LAKE script run nonexistant && false || true
$LAKE script doc nonexistant && false || true
$LAKE scripts

0 comments on commit 080cda1

Please sign in to comment.