-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(stories): create story packages for offline usage (#298)
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
dist | ||
dist-electron | ||
.vscode | ||
storage/**/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Zip each story into a package in ./storage/stories/{storyId}package.zip | ||
# The story content inside the package must be wrapped in a "story-{storyId}" folder | ||
# Usage: Just run './scripts/create-story-package.sh' from the project's root directory | ||
|
||
cd storage/stories | ||
|
||
for storyId in */; do | ||
tmpDir=/tmp/story-$storyId | ||
mkdir $tmpDir | ||
|
||
cp -r ./$storyId/* $tmpDir | ||
lastDir=(`pwd`) | ||
|
||
cd /tmp | ||
zip -r $lastDir/$storyId/package.zip ./story-$storyId | ||
cd $lastDir | ||
|
||
rm -r $tmpDir | ||
done |