shellcheck
This commit is contained in:
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
git diff --name-only $TRAVIS_COMMIT_RANGE
|
git diff --name-only "$TRAVIS_COMMIT_RANGE"
|
||||||
)
|
)
|
||||||
|
|
||||||
for file in $(git diff --name-only $TRAVIS_COMMIT_RANGE); do
|
for file in $(git diff --name-only "$TRAVIS_COMMIT_RANGE"); do
|
||||||
if [[ $file =~ ^"$1" ]]; then
|
if [[ $file =~ ^"$1" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -16,11 +16,11 @@ pip3 install git-filter-repo
|
|||||||
declare subdir=$1
|
declare subdir=$1
|
||||||
declare repo_name=$2
|
declare repo_name=$2
|
||||||
|
|
||||||
[[ -n $subdir ]] || {
|
[[ -n "$subdir" ]] || {
|
||||||
echo "Error: subdir not specified"
|
echo "Error: subdir not specified"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
[[ -n $repo_name ]] || {
|
[[ -n "$repo_name" ]] || {
|
||||||
echo "Error: repo_name not specified"
|
echo "Error: repo_name not specified"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -30,9 +30,9 @@ echo "Exporting $subdir"
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
rm -rf .github_export/"$repo_name"
|
rm -rf .github_export/"$repo_name"
|
||||||
git clone https://${GITHUB_TOKEN}@github.com/solana-labs/"$repo_name" .github_export/"$repo_name"
|
git clone https://"$GITHUB_TOKEN"@github.com/solana-labs/"$repo_name" .github_export/"$repo_name"
|
||||||
|
|
||||||
# TODO: Try using `--refs $TRAVIS_COMMIT_RANGE` to speed up the filtering
|
# TODO: Try using `--refs $TRAVIS_COMMIT_RANGE` to speed up the filtering
|
||||||
git filter-repo --subdirectory-filter "$subdir" --target .github_export/"$repo_name"
|
git filter-repo --subdirectory-filter "$subdir" --target .github_export/"$repo_name"
|
||||||
|
|
||||||
git -C .github_export/"$repo_name" push https://${GITHUB_TOKEN}@github.com/solana-labs/"$repo_name"
|
git -C .github_export/"$repo_name" push https://"$GITHUB_TOKEN"@github.com/solana-labs/"$repo_name"
|
||||||
|
Reference in New Issue
Block a user