Skip to content

Instantly share code, notes, and snippets.

View nguyenthang98's full-sized avatar
😀
Working

Nguyễn Đức Thắng nguyenthang98

😀
Working
  • Viet Nam
View GitHub Profile
@nguyenthang98
nguyenthang98 / check_file_changed_in_latest_commit.sh
Last active September 21, 2020 15:21
git extract information
#!/bin/bash
change_files="$(git diff --name-only HEAD HEAD~1 | xargs echo)"
test_files=$@
for file in $test_files; do
if [[ $change_files =~ (^|[[:space:]])"$file"($|[[:space:]]) ]]; then
echo "contain file $file"
else
echo "not contain file $file"
#!/bin/bash
attemp=5
count=0
while ! $(./check_script.sh >/tmp/script_stdout.log 2>/tmp/script_stderr.log) && [[ $count -lt $attemp ]]; do
count=$((count + 1))
echo "Check failed. Retrying ($(($attemp - count)) attemp remaining)..."
echo "==================DEBUG==================="
echo "STDOUT:"
cat /tmp/script_stdout.log
@nguyenthang98
nguyenthang98 / .block
Last active September 4, 2019 10:11
contour test
license: mit