mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 19:43:09 +00:00
35 lines
587 B
Text
35 lines
587 B
Text
|
#!/bin/bash -e
|
||
|
|
||
|
main() {
|
||
|
bundle install
|
||
|
bundle exec seed install
|
||
|
|
||
|
script/sort
|
||
|
|
||
|
echo "==> Removing CocoaSeed imports"
|
||
|
remove_seed_imports
|
||
|
}
|
||
|
|
||
|
remove_seed_imports() {
|
||
|
pushd Seeds/ > /dev/null
|
||
|
# Build a list of the seeded modules
|
||
|
MODULES=( )
|
||
|
for i in */; do
|
||
|
MODULES+=(${i%%/})
|
||
|
done
|
||
|
|
||
|
# Construct a pattern for module imports to remove
|
||
|
local pattern
|
||
|
pattern="/import ($(join "|" "${MODULES[@]}"))/d"
|
||
|
|
||
|
find . -name "*.swift" -type f -exec sed -Eie "${pattern}" {} \;
|
||
|
popd > /dev/null
|
||
|
}
|
||
|
|
||
|
join() {
|
||
|
local IFS="$1"; shift
|
||
|
echo "$*"
|
||
|
}
|
||
|
|
||
|
main
|