Skip to content

Commit

Permalink
chore: apply fixes from shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
metafates committed Feb 11, 2024
1 parent 8c603ed commit 33ac1fa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

cd $(dirname $0)
cd "$(dirname "$0")"
cp /code/cqfn-secrets/jpeek-settings-heroku.xml settings.xml
git add settings.xml
git commit -m 'settings.xml for dokku'
Expand Down
4 changes: 2 additions & 2 deletions ping-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
set -e

while IFS= read -r a; do
curl -s https://i.jpeek.org/${a}/index.html > /dev/null
curl -s "https://i.jpeek.org/${a}/index.html" > /dev/null
echo "${a} pinged"
done < artifacts.csv
done < artifacts.csv
8 changes: 4 additions & 4 deletions research/2018-April/04-collect-metrics/process-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jar=$1
output=$3
path=${2//.//}
meta=$(curl --fail --silent "https://repo1.maven.org/maven2/${path}/maven-metadata.xml")
version=$(echo ${meta} | xmllint --xpath '/metadata/versioning/latest/text()' -)
group=$(echo ${meta} | xmllint --xpath '/metadata/groupId/text()' -)
artifact=$(echo ${meta} | xmllint --xpath '/metadata/artifactId/text()' -)
version=$(echo "${meta}" | xmllint --xpath '/metadata/versioning/latest/text()' -)
artifact=$(echo "${meta}" | xmllint --xpath '/metadata/artifactId/text()' -)

home=$(pwd)
dir=$(mktemp -d /tmp/jpeek-XXXX)
# shellcheck disable=SC2064
trap "rm -rf ${dir}" EXIT
curl --fail --silent "https://repo1.maven.org/maven2/${path}/${version}/${artifact}-${version}.jar" > "${dir}/${artifact}.jar"
cd "${dir}"
Expand All @@ -46,4 +46,4 @@ unzip -o -q -d "${artifact}" "${artifact}.jar"
java -jar "${jar}" --sources "${artifact}" --target ./target --quiet
ruby "${home}/collect.rb" target >> "${output}"
cd
rm -rf ${dir}
rm -rf "${dir}"
4 changes: 2 additions & 2 deletions research/2018-April/04-collect-metrics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ home=$(pwd)
jar=~/.m2/repository/org/jpeek/jpeek/1.0-SNAPSHOT/jpeek-1.0-SNAPSHOT-jar-with-dependencies.jar
if [ ! -e "${jar}" ]; then
echo "${jar} doesn't exist, please run 'mvn clean install' first"
exit -1
exit 1
fi

rm -f "${home}/metrics.txt"

while read line
while read -r line
do
IFS=',' read -ra parts <<< "${line}"
echo "${parts[0]}..."
Expand Down

0 comments on commit 33ac1fa

Please sign in to comment.