diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2017-01-02 19:09:42 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2017-01-05 16:31:42 +0100 |
| commit | bf913af64821ef20ccb0f929ec1b555870ecc566 (patch) | |
| tree | 8ecf04eb285310474637567da9c154e2a8d3f2ee /dist.sh | |
| download | dist-bf913af64821ef20ccb0f929ec1b555870ecc566.tar.gz dist-bf913af64821ef20ccb0f929ec1b555870ecc566.zip | |
Initial
Diffstat (limited to 'dist.sh')
| -rwxr-xr-x | dist.sh | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -0,0 +1,44 @@ +#!/bin/zsh +setopt null_glob +cd $(dirname $(realpath $0)) +SRCDIR=$PWD/../ +SRCDIR=${SRCDIR:a} + +pushd .. +for script in $PWD/*.c4{d,f,g}/predist.sh; do + pushd ${script:h:t} + echo Executing $script in $PWD... + $script + popd +done +popd + +mv TodsStuff.c4d TodsStuff_bak.c4d +mkdir TodsStuff.c4d +pushd TodsStuff.c4d +cp -r ../../*.{c4{d,f,g},txt} . +rm -rf **/.git* *.c4{d,f,g}/predist.sh +for file in **/*.cp; do + echo Preprocessing $file... + c4cpp $file ${file%.cp}.c + rm $file +done + +for script in $PWD/*.c4{d,f,g}/dist.sh; do + pushd ${script:h:t} + export SRC=$SRCDIR/${PWD:t} + export DST=$PWD + echo Executing $script in $PWD... + $script + rm $script + popd +done + +popd +pushd TodsStuff_bak.c4d +files=(**/.git*) +popd +for file in $files; do + cp TodsStuff_bak.c4d/$file TodsStuff.c4d/$file +done +rm -r TodsStuff_bak.c4d |
