diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-12-06 17:42:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-06 17:42:16 -0500 |
commit | c1bb2e70e0a85227df899eccc6ac8cf661afe350 (patch) | |
tree | a12f43e34e0d32e68f0a14c9512b2b08af54829b /scripts | |
parent | faaf63ad895bd51541a9984273d52c71645a0b28 (diff) | |
parent | c7306cfdbaa50c89639fe38bb1b4005ed3555422 (diff) | |
download | puszcza-c1bb2e70e0a85227df899eccc6ac8cf661afe350.tar.gz puszcza-c1bb2e70e0a85227df899eccc6ac8cf661afe350.zip |
Merge pull request #14 from 19pdh/develop
Storybook and license
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/generateApi.js | 7 | ||||
-rwxr-xr-x | scripts/postbuild.sh | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js index f72745e..4b7426a 100755 --- a/scripts/generateApi.js +++ b/scripts/generateApi.js @@ -15,9 +15,12 @@ posts = posts.map(({ date, title, content, route }) => { } }) -posts.sort((a, b) => (a.route > b.route ? 1 : -1)) - fs.writeFile('./dist/api/posts.json', JSON.stringify(posts), err => err ? console.log(err) : null ) + +fs.writeFile('./static/api/posts.json', JSON.stringify(posts), err => + err ? console.log(err) : null +) + console.log(posts) diff --git a/scripts/postbuild.sh b/scripts/postbuild.sh index 85e35f9..6da3659 100755 --- a/scripts/postbuild.sh +++ b/scripts/postbuild.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash mkdir ./dist/api +mkdir ./static/api node -r esm ./scripts/generateApi.js |