From e3bec2a6afc9dfa0775dfaa3c21f7c8821b8d1ba Mon Sep 17 00:00:00 2001 From: Niels Hofmans Date: Fri, 27 Dec 2019 09:12:51 +0100 Subject: [PATCH 1/2] feat(maclaunch): add simple runs as user feature --- maclaunch.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/maclaunch.sh b/maclaunch.sh index 42cbe16..d4a099c 100755 --- a/maclaunch.sh +++ b/maclaunch.sh @@ -45,6 +45,22 @@ function isSystem { [[ $1 == /System/* ]] } +function getScriptUser { + local scriptPath="$1" + + if echo "$scriptPath" | grep -q "LaunchAgent"; then + whoami + return + fi + + if ! grep -q 'UserName' "$scriptPath"; then + echo "root" + return + fi + + echo "custom" +} + function listItems { itemDirectories=("${startup_dirs[@]}") @@ -127,8 +143,16 @@ function listItems { startup_type=" (core)" fi + runAsUser="$(getScriptUser "$f")" + if [ "$runAsUser" = "root" ]; then + runAsUser="${RED}root${NC}" + elif [ "$runAsUser" = "custom" ]; then + runAsUser="${YELLOW}custom${NC}" + fi + echo -e "${BOLD}> ${startup_name}${NC}${startup_type}" echo " Type : ${type}" + echo -e " User : ${runAsUser}" echo -e " Launch: ${load_str}${NC}" echo " File : $f" From 280fd2fb4cdb606eef111ae772534137052a6189 Mon Sep 17 00:00:00 2001 From: Niels Hofmans Date: Fri, 27 Dec 2019 09:14:46 +0100 Subject: [PATCH 2/2] chore(cicd): fix reviewdog reporter --- .github/workflows/shellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index af8de43..c5c88df 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -10,4 +10,4 @@ jobs: uses: reviewdog/action-shellcheck@v1 with: github_token: ${{ secrets.github_token }} - reporter: CI/CD + reporter: github-pr-review