diff --git a/README.md b/README.md index 67c101d..f9c1ec9 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ for and whose design I took as reference, keeping compatibility when possible. * fix the pipeline because it's broken. The last release and its artifacts are wrong. -* add ain install/uninstall script to the any-linux package. +* add an install/uninstall script to the any-linux package. * finish the `summary` formatter. * match formatters by prefix (so there's no need to type all of its name if the prefix is unambiguous). diff --git a/scripts/build.sh b/scripts/build.sh index 61c2609..03aee2c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,17 +16,20 @@ cargo test cargo build --locked --release # move binary -install -m 755 -D target/release/t build/bin/t +install -Dm755 target/release/t build/bin/t # move documentation -install -m 644 -D CHANGELOG.md build/share/doc/tiempo/CHANGELOG.md -install -m 644 -D README.md build/share/doc/tiempo/README.md -install -m 644 -D LICENSE build/share/doc/tiempo/LICENSE +install -Dm644 CHANGELOG.md build/share/doc/tiempo/CHANGELOG.md +install -Dm644 README.md build/share/doc/tiempo/README.md +install -Dm644 LICENSE build/share/doc/tiempo/LICENSE # move man page -install -m 644 -D docs/build/man/tiempo.1.gz build/share/man/man1/tiempo.1.gz +install -Dm644 docs/build/man/tiempo.1.gz build/share/man/man1/tiempo.1.gz # move completions -install -m 644 -D completions/bash/t build/share/bash-completion/completions/t -install -m 644 -D completions/fish/t.fish build/share/fish/vendor_completions.d/t.fish -install -m 644 -D completions/zsh/_t build/share/zsh/site-functions/_t +install -Dm644 completions/bash/t build/share/bash-completion/completions/t +install -Dm644 completions/fish/t.fish build/share/fish/vendor_completions.d/t.fish +install -Dm644 completions/zsh/_t build/share/zsh/site-functions/_t +# move install scripts +install -Dm755 scripts/install.sh build/install.sh +install -Dm755 scripts/uninstall.sh build/uninstall.sh # compress the tar file tar -cvzf tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz build/ diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100644 index 0000000..18b96e4 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +__dir=$(dirname $(realpath $0)) +prefix=${1:-/usr} + +install -Dm755 $__dir/bin/t $prefix/bin/t +install -Dm644 $__dir/share/fish/vendor_completions.d/t.fish $prefix/share/fish/vendor_completions.d/t.fish +install -Dm644 $__dir/share/doc/tiempo/README.md $prefix/share/doc/tiempo/README.md +install -Dm644 $__dir/share/doc/tiempo/CHANGELOG.md $prefix/share/doc/tiempo/CHANGELOG.md +install -Dm644 $__dir/share/doc/tiempo/LICENSE $prefix/share/doc/tiempo/LICENSE +install -Dm644 $__dir/share/bash-completion/completions/t $prefix/share/bash-completion/completions/t +install -Dm644 $__dir/share/zsh/site-functions/_t $prefix/share/zsh/site-functions/_t +install -Dm644 $__dir/share/man/man1/tiempo.1.gz $prefix/share/man/man1/tiempo.1.gz diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh new file mode 100644 index 0000000..9977ff1 --- /dev/null +++ b/scripts/uninstall.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +rm -f /usr/bin/t + +prefix=${1:-/usr} + +rm -f $prefix/bin/t +rm -rf $prefix/share/doc/tiempo/ +rm -f $prefix/share/fish/vendor_completions.d/t.fish +rm -f $prefix/share/bash-completion/completions/t +rm -f $prefix/share/zsh/site-functions/_t +rm -f $prefix/share/man/man1/tiempo.1.gz