1
1
mirror of https://github.com/primer/css.git synced 2024-11-23 11:27:26 +03:00

publish: copy all src/* before publishing, clean up post

This commit is contained in:
Shawn Allen 2019-02-04 13:58:18 -08:00
parent e1e2b9f55e
commit 8895827eac
4 changed files with 20 additions and 1 deletions

1
.gitignore vendored
View File

@ -9,4 +9,5 @@ _site
build/
node_modules
primer-version.txt
publish-files.txt
static/primer.css

View File

@ -34,7 +34,9 @@
"check-links": "script/check-links http://localhost:3000/css -v",
"test-all-modules": "ava --verbose tests/test-*.js",
"now-build": "next build",
"now-start": "next start"
"now-start": "next start",
"prepublishOnly:" "script/prepublish",
"postpublish": "script/postpublish"
},
"devDependencies": {
"@githubprimer/octicons-react": "^8.1.3",

9
script/postpublish Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
file=publish-files.txt
if [[ -f $file ]]; then
echo "deleting all files listed in $file..."
cat $file | xargs rm -rfv
rm $file
fi

7
script/prepublish Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
files=$(git ls-files src | sed -e 's#^src/##' | sed -e 's#/.*$##' | sort -u)
echo $files > publish-files.txt
cd src
cp -rv $files ..
cd -