diff --git a/scripts/publish.sh b/scripts/publish.sh index cc21fb3..338b199 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -8,8 +8,16 @@ publish_npm() { clean() { pkg="$1" - exclude_regex="\.\|\./\.git\|\./packages\|\./\|\./packages/$pkg\|\./LICENSE" - find . -maxdepth 2 -not -regex "$exclude_regex" -exec rm -rf {} + + # TODO: use regex instead + find . -maxdepth 2 \ + ! -path . \ + ! -path ./.git \ + ! -path "./.git/*" \ + ! -path ./.gitignore \ + ! -path ./packages \ + ! -path ./LICENSE \ + ! -path "./packages/$pkg" \ + -exec rm -rf {} + } publish_forge_pkg() { @@ -22,7 +30,7 @@ publish_forge_pkg() { mv "packages/$pkg"/src . mv "packages/$pkg"/README.md . rm -fr "packages/$pkg" - git commit -am "$version" + Git commit -am "$version" git push origin "$pkg" git checkout main