forked from qmlbook/qt6book
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yarn: created command to build example tarball
- Loading branch information
Showing
5 changed files
with
61 additions
and
5 deletions.
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 |
---|---|---|
|
@@ -109,6 +109,7 @@ build-* | |
|
||
# Examples build output | ||
_examples/ | ||
examples.tar.gz | ||
|
||
# Python | ||
.venv | ||
|
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
File renamed without changes.
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,40 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Script to build a tarball of all examples from Qt6 Book | ||
# | ||
# Moves the docs/CHAPTER/src/EXAMPLE into a qt6book/CHAPTER/EXAMPLE structure | ||
# | ||
|
||
set -e | ||
|
||
tmpdir=$(mktemp -d) | ||
mkdir -p $tmpdir/qt6book | ||
|
||
for exdir in docs/*/src; do | ||
chname=$(echo $exdir | sed 's/^docs\///;s/\/src$//;') | ||
mkdir -p "$tmpdir/qt6book/$chname" | ||
|
||
cd docs/$chname/src | ||
for exexdir in *; do | ||
# Skip build- dirs (created by Qt Creator) | ||
if [[ $exexdir == build-* ]]; then | ||
continue | ||
fi | ||
# Skip screenshots.qml file | ||
if [[ $exexdir == "screenshots.qml" ]]; then | ||
continue | ||
fi | ||
|
||
tar cf - $exexdir | (cd $tmpdir/qt6book/$chname; tar xfp -) | ||
done | ||
cd ../../.. | ||
done | ||
|
||
# Create a resulting examples.tar.gz file where vuepress places the built site and at $(pwd) | ||
destdir=$(pwd) | ||
(cd $tmpdir; tar cvfz $destdir/examples.tar.gz qt6book/ > /dev/null) | ||
cp examples.tar.gz docs/.vuepress/dist/ | ||
|
||
# Clean up the temporary directory | ||
rm -rf $tmpdir |