diff --git a/lint_string.sh b/lint_string.sh index 2e571861..02080b6d 100755 --- a/lint_string.sh +++ b/lint_string.sh @@ -1,6 +1,6 @@ #!/bin/bash -grep -rE --include="*.rs" "$1" . -if [ $? -eq 0 ]; then + +if grep -rE --include="*.rs" "$1" .; then echo "'$1's found." exit 1 else diff --git a/manual_test.sh b/manual_test.sh index 60420001..9d92fee4 100755 --- a/manual_test.sh +++ b/manual_test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Does not cover the complete function # Run it manually to ensure that we didn't break clap @@ -33,8 +33,8 @@ commands=( for cmd in "${commands[@]}" do echo "Executing command: $cmd" - eval "$cmd" - if [ $? -ne 0 ]; then + + if ! eval "$cmd"; then echo "Command failed: $cmd" exit 1 fi diff --git a/push_aur.sh b/push_aur.sh index 742731a1..a1df7a55 100755 --- a/push_aur.sh +++ b/push_aur.sh @@ -1,12 +1,13 @@ -#!/bin/sh -cd ../tod-bin/ +#!/bin/bash + +cd ../tod-bin/ || exit git pull -cd ../tod/ +cd ../tod/ || exit makepkg --printsrcinfo > ../tod-bin/.SRCINFO mv PKGBUILD ../tod-bin/ -rm *.tar.gz -cd ../tod-bin/ +rm ./*.tar.gz +cd ../tod-bin/ || exit git add . git commit -m "new version" git push aur -cd ../tod \ No newline at end of file +cd ../tod || exit \ No newline at end of file diff --git a/setup_aur.sh b/setup_aur.sh index 77b8aec1..e2c3c58f 100755 --- a/setup_aur.sh +++ b/setup_aur.sh @@ -1,5 +1,7 @@ -cd ~/dev +#!/bin/bash + +cd ~/dev || exit git clone ssh://aur@aur.archlinux.org/tod-bin.git -cd tod-bin +cd tod-bin || exit git remote add aur ssh://aur@aur.archlinux.org/tod-bin.git -cd ../tod +cd ../tod || exit diff --git a/src/request.rs b/src/request.rs index 8527e95f..7e4f0af4 100644 --- a/src/request.rs +++ b/src/request.rs @@ -126,6 +126,7 @@ pub fn complete_item(config: &Config) -> Result { } /// Post to Todoist via sync API +/// We use sync when we want natural languague processing. fn post_todoist_sync( config: &Config, url: String, @@ -161,6 +162,7 @@ fn post_todoist_sync( } /// Post to Todoist via REST api +/// We use this when we want more options and don't need natural language processing fn post_todoist_rest( config: &Config, url: String, diff --git a/test.sh b/test.sh index 8f086340..83d1f423 100755 --- a/test.sh +++ b/test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash cargo fmt && cargo clippy -- -D warnings && cargo tarpaulin -o lcov && diff --git a/update_test.sh b/update_test.sh index 657cdae7..3e8d9533 100755 --- a/update_test.sh +++ b/update_test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash cargo update && \ ./test.sh && \ ./manual_test.sh && \ diff --git a/watch.sh b/watch.sh deleted file mode 100755 index e842c2e8..00000000 --- a/watch.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -cargo watch -x check -x clippy -x test -s "rg TODO --type rust" && \ -echo "SUCCESS" - -