mirror of
https://github.com/anoma/juvix.git
synced 2025-01-08 16:51:53 +03:00
d59fca6786
This PR adds the `juvix clean` command to the CLI that removes the Juvix project build directory. It respects the `--internal-build-dir` global option: ``` $ juvix compile Foo.juvix --internal-build-dir /tmp/build $ juvix clean --internal-build-dir /tmp/build ``` In addition this PR fixes the `juvix format` program brief description string. This was too long for the `juvix --help` display. The longer description is now only displayed when `juvix format --help` is run. * Closes https://github.com/anoma/juvix/issues/2017
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
working-directory: ./../../../
|
|
|
|
tests:
|
|
- name: clean-with-no-build-dir
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
temp=$(mktemp -d)
|
|
trap 'rm -rf -- "$temp"' EXIT
|
|
cd $temp
|
|
juvix clean
|
|
stdout: ""
|
|
exit-status: 0
|
|
|
|
- name: clean-with-default-build-dir
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
temp=$(mktemp -d)
|
|
trap 'rm -rf -- "$temp"' EXIT
|
|
cd ./examples/milestone/HelloWorld
|
|
juvix compile -o $temp/Hello HelloWorld.juvix
|
|
juvix clean
|
|
[ -d $temp/.juvix-build ]
|
|
stdout: ""
|
|
exit-status: 1
|
|
|
|
- name: clean-with-internal-build-dir
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
temp=$(mktemp -d)
|
|
trap 'rm -rf -- "$temp"' EXIT
|
|
temp_build_dir=$(mktemp -d)
|
|
trap 'rm -rf -- "$temp_build_dir"' EXIT
|
|
cd ./examples/milestone/HelloWorld
|
|
juvix compile -o $temp/Hello HelloWorld.juvix --internal-build-dir "$temp_build_dir"
|
|
juvix --internal-build-dir "$temp_build_dir" clean
|
|
[ -d $temp_build_dir ]
|
|
stdout: ""
|
|
exit-status: 1
|
|
|
|
- name: clean-with-internal-build-dir-does-not-remove-default-build-dir
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
temp=$(mktemp -d)
|
|
trap 'rm -rf -- "$temp"' EXIT
|
|
temp_build_dir=$(mktemp -d)
|
|
trap 'rm -rf -- "$temp_build_dir"' EXIT
|
|
cp -r ./examples/milestone/HelloWorld/. $temp
|
|
cd $temp
|
|
juvix compile HelloWorld.juvix
|
|
juvix --internal-build-dir "$temp_build_dir" clean
|
|
[ -d $temp/.juvix-build ]
|
|
stdout: ""
|
|
exit-status: 0
|