Skip to content

Commit

Permalink
fix: clean up shellcheck warnings in act runner script
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 committed Sep 2, 2023
1 parent ee5402d commit 1cb2199
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions act/run-act.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
#!/bin/bash
#!/usr/bin/env bash
set -eo pipefail

type=$1
# bump=$2

oldartifactsdir="old"

parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"

artifactfolders=$(find artifacts/ -maxdepth 1 -mindepth 1 -type d)
if [[ ${#artifactfolders[@]} > 0 ]]; then
for i in ${artifactfolders[@]}; do
foldername=$(dirname $i)
subfoldername=$(basename $i)
out=$foldername/$oldartifactsdir/$subfoldername-$(date +'%s')
if [[ ! "$subfoldername" =~ "$oldartifactsdir" ]]; then
mkdir -p $out
mv $i $out
printf "Moved "${foldername}"/"${subfoldername}" to "${out}" \n"
fi
done
fi
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
cd "$parent_path" || exit

for i in artifacts/*; do
if [[ ! -d "$i" ]]; then
continue;
fi
subfoldername=$(basename "$i")

if [[ "$subfoldername" == "$oldartifactsdir" ]]; then
continue;
fi

out=artifacts/$oldartifactsdir/$subfoldername-$(date +'%s')
mkdir -p "$out"
mv "$i" "$out"
echo "Moved artifacts/${subfoldername} to ${out}"
done

cd ..

Expand All @@ -35,10 +38,10 @@ else
printf "Options: 'release' or 'prerelease'\n"
fi

cd act/artifacts
cd act/artifacts || exit

if [[ -d "1" ]]; then
cd "1/artifact"
cd "1/artifact" || exit
cp "PluginLoader.gz__" "PluginLoader.gz"
gzip -d "PluginLoader.gz"
chmod +x PluginLoader
Expand Down

0 comments on commit 1cb2199

Please sign in to comment.