update source-setup force options

mostly, use `git clean -ffX .` instead of `find | xargs`
to delete files to use .gitignore as the source of truth
This commit is contained in:
Jon Ruskin 2022-12-23 07:17:40 -07:00
Родитель c1b271a9f4
Коммит cefab57e77
15 изменённых файлов: 26 добавлений и 44 удалений

Просмотреть файл

@ -11,7 +11,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/bower
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" -and -not -name "bower\.json" -print0 | xargs -0 rm -rf
git clean -ffX .
fi
bower install

Просмотреть файл

@ -14,7 +14,12 @@ cd $BASE_PATH/test/fixtures/bundler
unset BUNDLE_GEMFILE
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" -and -not -name "Gemfile" -and -not \( -path ./pathed-gem-fixture -prune \) -print0 | xargs -0 rm -rf
echo "cleaning"
git clean -ffX .
fi
bundle install --path vendor/gems --without ignore
sleep 5
bundle config set path 'vendor/gems'
bundle config set without ignore
bundle install

Просмотреть файл

@ -13,7 +13,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/cabal
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" -and -not -path "*app*" -print0 | xargs -0 rm -rf
git clean -ffX .
fi
(cabal new-update && cabal new-build) || (cabal update && cabal install)

Просмотреть файл

@ -13,11 +13,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/cargo
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" \
-and -not -path "*/Cargo.lock" \
-and -not -path "*/Cargo.toml" \
-and -not -path "*/src*" \
-print0 | xargs -0 rm -rf
cargo clean
fi
cargo build

Просмотреть файл

@ -10,8 +10,9 @@ fi
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/cocoapods
OPTIONS=()
if [ "$1" == "-f" ]; then
pod install --clean-install
OPTIONS+="--clean-install"
fi
pod install
pod install ${OPTIONS[@]}

Просмотреть файл

@ -11,7 +11,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/composer
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" -and -not -name "composer\.json" -print0 | xargs -0 rm -rf
git clean -ffX .
fi
if [ ! -f "composer.phar" ]; then

Просмотреть файл

@ -18,12 +18,7 @@ export GO111MODULE=off
cd "$BASE_PATH/test/fixtures/dep"
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" \
-and -not -path "*/src/test*" \
-and -not -path "*/pkg/mod*" \
-and -not -path "*/pkg" \
-and -not -path "*/src" \
-print0 | xargs -0 rm -rf
git clean -ffX .
fi
cd src/test

Просмотреть файл

@ -5,14 +5,14 @@ set -e
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/git_submodule
if [ "$1" == "-f" ]; then
git clean -ffX .
fi
FIXTURES="$(pwd)/nested $(pwd)/submodule $(pwd)/project"
SUBMODULE=""
echo "setting up git_submodule test fixtures"
for fixture in $FIXTURES; do
if [ "$1" == "-f" ]; then
rm -rf $fixture
fi
mkdir -p $fixture
pushd $fixture >/dev/null

Просмотреть файл

@ -12,13 +12,7 @@ export GOPATH="$BASE_PATH/test/fixtures/go"
cd "$BASE_PATH/test/fixtures/go"
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" \
-and -not -path "*/src/test*" \
-and -not -path "*/pkg/mod*" \
-and -not -path "*/pkg" \
-and -not -path "*/src" \
-print0 | xargs -0 rm -rf
git clean -ffX .
go clean -modcache
fi

Просмотреть файл

@ -10,13 +10,8 @@ fi
BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/npm
FORCE=""
if [ "$1" == "-f" ]; then
FORCE=1
fi
if [ -n "$FORCE" ]; then
find . -not -regex "\.*" -and -not -name "package\.json*" -print0 | xargs -0 rm -rf
git clean -ffX .
fi
NPM_MAJOR_VERSION="$(npm -v | cut -d'.' -f1)"

Просмотреть файл

@ -19,7 +19,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
# clean up any previous fixture venv that might have been created.
if [ "$1" == "-f" ]; then
echo "removing old fixture setup..."
rm -rf $BASE_PATH/test/fixtures/pip/venv
git clean -ffX .
fi
# set up a virtualenv and install the packages in the test requirements

Просмотреть файл

@ -18,4 +18,4 @@ if [ "$1" == "-f" ]; then
fi
# set up a virtualenv and install the packages in the test requirements
pipenv update
pipenv install

Просмотреть файл

@ -12,11 +12,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd $BASE_PATH/test/fixtures/swift
if [ "$1" == "-f" ]; then
find . -not -regex "\.*" \
-and -not -path "*/Package.swift" \
-and -not -path "*/Sources*" \
-and -not -path "*/Tests*" \
-print0 | xargs -0 rm -rf
swift package reset
fi
swift package resolve

Просмотреть файл

@ -11,7 +11,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd $BASE_PATH/test/fixtures/yarn/berry
if [ "$1" == "-f" ]; then
git clean -fX .
git clean -ffX .
fi
yarn install

Просмотреть файл

@ -11,7 +11,7 @@ BASE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd $BASE_PATH/test/fixtures/yarn/v1
if [ "$1" == "-f" ]; then
git clean -fX .
git clean -ffX .
fi
yarn install