Skip to content

Commit

Permalink
fix: rename 'samples' to 'effective-shell' (#332)
Browse files Browse the repository at this point in the history
* fix: rename 'samples' to 'effective-shell'

* fix: correct build samples script

* fix: correct path of samples build
  • Loading branch information
dwmkerr committed May 20, 2024
1 parent a17c9f8 commit 60f9168
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ typescript-check: # Check typescript types.
build: # Build the site and artifacts.
mkdir -p ./static/downloads
./scripts/build-samples.sh
cp ./artifacts/samples.zip ./static/downloads/effective-shell-samples.zip
cp ./artifacts/samples.tar.gz ./static/downloads/effective-shell-samples.tar.gz
cp ./artifacts/effective-shell-samples.zip ./static/downloads/effective-shell-samples.zip
cp ./artifacts/effective-shell-samples.tar.gz ./static/downloads/effective-shell-samples.tar.gz
test -e ./static/downloads/effective-shell-samples.zip
test -e ./static/downloads/effective-shell-samples.tar.gz
npm ci --legacy-peer-deps && npm run build
Expand Down
18 changes: 11 additions & 7 deletions scripts/build-samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,34 @@ set -x

# First, trash the samples folder if it exists in the artifacts folder. Then
# create a new folder based on the current samples.
[ -d ./artifacts/samples ] && rm -rf ./artifacts/samples
[ -d ./artifacts/effective-shell ] && rm -rf ./artifacts/effective-shell
mkdir -p ./artifacts
cp -r ./samples ./artifacts

# For the purposes of the downloadable samples, the folder is called
# 'effective shell' - just like what we'd create with the instal script.
mv ./artifacts/samples ./artifacts/effective-shell

# Copy over the version identifier.
cp package.json ./artifacts/samples/.package.json
cp package.json ./artifacts/effective-shell/.package.json

# Clone our sample repositories. If we have repositories that should not have
# remotes (i.e. for the chapter on getting started with git, where we work with
# a local repository only) we just remove the remote.
mkdir -p ./artifacts/samples/repositories
( cd ./artifacts/samples/repositories \
mkdir -p ./artifacts/effective-shell/repositories
( cd ./artifacts/effective-shell/repositories \
&& git clone git://github.com/effective-shell/chapter-27-dotfiles \
&& cd chapter-27-dotfiles \
&& git remote remove origin \
&& rm -rf ./.git \
)
( cd ./artifacts/samples/repositories \
( cd ./artifacts/effective-shell/repositories \
&& git clone git://github.com/effective-shell/chapter-28-dotfiles \
&& cd chapter-28-dotfiles \
&& git remote remove origin \
&& rm -rf ./.git \
)

# Zip up and tar up the samples
(cd ./artifacts && zip -r ./samples.zip ./samples)
tar czf ./artifacts/samples.tar.gz -C ./artifacts/samples .
(cd ./artifacts && zip -r ./effective-shell-samples.zip ./effective-shell)
tar czf ./artifacts/effective-shell-samples.tar.gz -C ./artifacts/effective-shell .

0 comments on commit 60f9168

Please sign in to comment.