File tree Expand file tree Collapse file tree 19 files changed +56
-25
lines changed 
anomaly/modules/tmux/scripts 
coder-labs/modules/archive 
mavrickrishi/modules/auto-start-dev-server Expand file tree Collapse file tree 19 files changed +56
-25
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ create_incident() {
8282#  Function to check for existing unresolved incidents
8383check_existing_incident () {
8484  #  Fetch the latest incidents with status not equal to "RESOLVED"
85-   local  unresolved_incidents=$( curl -s -X GET " https://api.instatus.com/v1/$INSTATUS_PAGE_ID /incidents" 
85+   local  unresolved_incidents
86+   unresolved_incidents=$( curl -s -X GET " https://api.instatus.com/v1/$INSTATUS_PAGE_ID /incidents" 
8687    -H " Authorization: Bearer $INSTATUS_API_KEY "  
8788    -H " Content-Type: application/json" |  jq -r ' .incidents[] | select(.status != "RESOLVED") | .id' )  
8889
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ main() {
144144  printf  " $$ {BOLD}✅ tmux setup complete! \n\n" 
145145
146146  printf  " $$ {BOLD} Attempting to restore sessions\n" 
147-   tmux new-session -d \;  source-file ~ /.tmux.conf \;  run-shell ' ~ /.tmux/plugins/tmux-resurrect/scripts/restore.sh' 
147+   tmux new-session -d \;  source-file ~ /.tmux.conf \;  run-shell " $HOME /.tmux/plugins/tmux-resurrect/scripts/restore.sh" 
148148  printf  " $$ {BOLD} Sessions restored: -> %s\n" " $( tmux ls) " 
149149
150150}
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ EXTRACT_ON_START="${TF_EXTRACT_ON_START}"
66EXTRACT_WAIT_TIMEOUT=" ${TF_EXTRACT_WAIT_TIMEOUT} " 
77
88#  Set script defaults from Terraform.
9- DEFAULT_PATHS=( ${TF_PATHS} ) 
10- DEFAULT_EXCLUDE_PATTERNS=( ${TF_EXCLUDE_PATTERNS} ) 
9+ IFS= '   '   read  -r -a DEFAULT_PATHS  <<<   " ${TF_PATHS}" 
10+ IFS= '   '   read  -r -a DEFAULT_EXCLUDE_PATTERNS  <<<   " ${TF_EXCLUDE_PATTERNS}" 
1111DEFAULT_COMPRESSION=" ${TF_COMPRESSION} " 
1212DEFAULT_ARCHIVE_PATH=" ${TF_ARCHIVE_PATH} " 
1313DEFAULT_DIRECTORY=" ${TF_DIRECTORY} " 
@@ -62,6 +62,7 @@ echo "Installed extract script to:  $EXTRACT_WRAPPER_PATH"
6262
6363#  3) Optionally wait for and extract an archive on start.
6464if  [[ $EXTRACT_ON_START  =  true  ]];  then 
65+   #  shellcheck disable=SC1090
6566  .  " $LIB_PATH " 
6667
6768  archive_wait_and_extract " $EXTRACT_WAIT_TIMEOUT " ||  {
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ function extension_installed() {
8888  if  [ " ${USE_CACHED_EXTENSIONS} " !=  true  ];  then 
8989    return  1
9090  fi 
91+   #  shellcheck disable=SC2066
9192  for  _extension  in  " $$ {EXTENSIONS_ARRAY[@]}" ;  do 
9293    if  [ " $_extension " ==  " $1 " ;  then 
9394      echo  " Extension $1  was already installed." 
@@ -99,6 +100,7 @@ function extension_installed() {
99100
100101#  Install each extension...
101102IFS=' ,' read  -r -a EXTENSIONLIST <<<  " $${EXTENSIONS}" 
103+ #  shellcheck disable=SC2066
102104for  extension  in  " $$ {EXTENSIONLIST[@]}" ;  do 
103105  if  [ -z  " $extension " ;  then 
104106    continue 
Original file line number Diff line number Diff line change 44#  might contain a `package.json` with `packageManager` set to something
55#  other than the detected package manager. When this happens, it can
66#  cause the installation to fail.
7- cd  " $CODER_SCRIPT_DATA_DIR " 
7+ cd  " $CODER_SCRIPT_DATA_DIR "   ||   exit 
88
99#  If @devcontainers/cli is already installed, we can skip
1010if  command  -v devcontainer >  /dev/null 2>&1 ;  then 
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ set -euo pipefail
55DOTFILES_URI=" ${DOTFILES_URI} " 
66DOTFILES_USER=" ${DOTFILES_USER} " 
77
8+ #  shellcheck disable=SC2157
89if  [ -n  " $$ {DOTFILES_URI// }" ;  then 
910  if  [ -z  " $DOTFILES_USER " ;  then 
1011    DOTFILES_USER=" $USER " 
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ if [ -n "$POST_CLONE_SCRIPT" ]; then
6060  echo  " Running post-clone script..." 
6161  echo  " $POST_CLONE_SCRIPT " |  base64 -d >  /tmp/post_clone.sh
6262  chmod +x /tmp/post_clone.sh
63-   cd  " $CLONE_PATH " 
63+   cd  " $CLONE_PATH "   ||   exit 
6464  /tmp/post_clone.sh
6565  rm /tmp/post_clone.sh
6666fi 
Original file line number Diff line number Diff line change 7373
7474START=$( date +%s%N) 
7575#  Run all arguments as a command
76- $@ 
76+ " $@ " 
7777END=$( date +%s%N) 
7878DURATION_MS=$$ {DURATION_MS:-$(( (END -  START) /  1000000 )) 
7979PRETTY_DURATION=$( pretty_duration $DURATION_MS ) 
8080
8181set  -e
82- COMMAND=$( echo $@ ) 
82+ COMMAND=$( echo " $@ " ) 
8383SLACK_MESSAGE=$( echo " $SLACK_MESSAGE " |  sed " s|\\ $COMMAND |$COMMAND |g" ) 
8484SLACK_MESSAGE=$( echo " $SLACK_MESSAGE " |  sed " s|\\ $DURATION |$PRETTY_DURATION |g" ) 
8585
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ install() {
4646  if  [ " $$ {INSTALL_VERSION}" =  " latest" ;  then 
4747    LATEST_VERSION=$( curl -s https://releases.hashicorp.com/vault/ |  grep -v ' rc' |  grep -oE ' vault/[0-9]+\.[0-9]+\.[0-9]+' |  sed ' s/vault\///' |  sort -V |  tail -n 1) 
4848    printf  " Latest version of Vault is %s.\n\n" " $$ {LATEST_VERSION}" 
49+     #  shellcheck disable=SC2157
4950    if  [ -z  " $$ {LATEST_VERSION}" ;  then 
5051      printf  " Failed to determine the latest Vault version.\n" 
5152      return  1
@@ -63,8 +64,10 @@ install() {
6364    fi 
6465  fi 
6566
67+   #  shellcheck disable=SC2170
6668  if  [ $$ {installation_needed} -eq  1 ];  then 
6769    #  Download and install Vault
70+     #  shellcheck disable=SC2157
6871    if  [ -z  " $$ {CURRENT_VERSION}" ;  then 
6972      printf  " Installing Vault CLI ...\n\n" 
7073    else 
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ install() {
4747  if  [ " $$ {VAULT_CLI_VERSION}" =  " latest" ;  then 
4848    LATEST_VERSION=$( curl -s https://releases.hashicorp.com/vault/ |  grep -v ' rc' |  grep -oE ' vault/[0-9]+\.[0-9]+\.[0-9]+' |  sed ' s/vault\///' |  sort -V |  tail -n 1) 
4949    printf  " Latest version of Vault is %s.\n\n" " $$ {LATEST_VERSION}" 
50+     #  shellcheck disable=SC2157
5051    if  [ -z  " $$ {LATEST_VERSION}" ;  then 
5152      printf  " Failed to determine the latest Vault version.\n" 
5253      return  1
@@ -64,8 +65,10 @@ install() {
6465    fi 
6566  fi 
6667
68+   #  shellcheck disable=SC2170
6769  if  [ $$ {installation_needed} -eq  1 ];  then 
6870    #  Download and install Vault
71+     #  shellcheck disable=SC2157
6972    if  [ -z  " $$ {CURRENT_VERSION}" ;  then 
7073      printf  " Installing Vault CLI ...\n\n" 
7174    else 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments