diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 6d898a2..c09995e 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -20,16 +20,18 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it uses: actions/checkout@v2 - # - name: "install TeXLive" - # # Actually pick a version, do not point on master, or the build won't be reproducible + - name: "Setup TeX Live" + # ## # uses: DanySK/setup-texlive-action@master - # # You can omit the following if the default path is ok with you # with: # requirements-file: .github/texlive/requirements.txt - - name: "Setup TeX Live" - uses: teatimeguest/setup-texlive-action@v1 - with: - package-file: .github/texlive/requirements.txt + # ## + # uses: teatimeguest/setup-texlive-action@v1 + # with: + # package-file: .github/texlive/requirements.txt + # ## + uses: paolobrasolin/setup-texlive-action@v1 + packages-path: ${{ github.workspace }}/.github/texlive/requirements.txt - name: "install tikz-trackschematic" run: | diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c95cca1..6a57bf6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -24,16 +24,18 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it uses: actions/checkout@v2 - # - name: "install TeXLive" - # # Actually pick a version, do not point on master, or the build won't be reproducible + - name: "Setup TeX Live" + # ## # uses: DanySK/setup-texlive-action@master - # # You can omit the following if the default path is ok with you # with: # requirements-file: .github/texlive/requirements.txt - - name: "Setup TeX Live" - uses: teatimeguest/setup-texlive-action@v1 - with: - package-file: .github/texlive/requirements.txt + # ## + # uses: teatimeguest/setup-texlive-action@v1 + # with: + # package-file: .github/texlive/requirements.txt + # ## + uses: paolobrasolin/setup-texlive-action@v1 + packages-path: ${{ github.workspace }}/.github/texlive/requirements.txt - name: "install tikz-trackschematic" run: | diff --git a/dev-install.sh b/dev-install.sh index f23b9c6..7ea5472 100755 --- a/dev-install.sh +++ b/dev-install.sh @@ -26,12 +26,15 @@ while getopts ":qb" opt; do esac done +## -- variables + +# destination folder inside the TeX Live installation +DEVDIR="tex/latex/local/tikz-trackschematic-dev" + ## -- commands -TEXlsr=`which mktexlsr` - +# check for kpsewhich (and mktexlsr) check_texlive() { - # check for kpsewhich status=0 command -v kpsewhich >/dev/null 2>&1 || status=1 if [ $status = 0 ]; then @@ -78,9 +81,6 @@ check_texlive check_sudo TEXMFLOCAL=$(kpsewhich --var-value TEXMFLOCAL) - -DEVDIR="tex/latex/tikz-trackschematic-dev" - PROJECTDIR=$(pwd -P) if [ "$batch_mode" -eq 0 ]; then @@ -101,12 +101,36 @@ fi ## -- copying files +# make sure that destination folder exists if [ ! -d "$TEXMFLOCAL/$DEVDIR" ]; then $rootrun mkdir -p $TEXMFLOCAL/$DEVDIR fi +# copy every file in src/ and rename it for SRC in src/*; do - $rootrun ln -sfn $PROJECTDIR/$SRC $TEXMFLOCAL/$DEVDIR/${SRC##*/} + FILE=$(basename "$SRC") # remove path + NAME=${FILE%.*} # remove extension + PREFIX=${NAME%%.*} + POSTFIX=${NAME#*.} + EXT=${SRC##*.} + + if [ "$PREFIX" = "$POSTFIX" ]; then + DST="$PREFIX-dev.$EXT" + else + DST="$PREFIX-dev.$POSTFIX.$EXT" + fi + + $rootrun ln -sfn $PROJECTDIR/$SRC $TEXMFLOCAL/$DEVDIR/$DST + + if [ "$verbose" -eq 1 ]; then + echo "linked '$DST'" + fi done -$rootrun $TEXlsr --quiet +# update TeX Live installation +TEXlsr=`which mktexlsr` +if [ "$verbose" -eq 1 ]; then + $rootrun $TEXlsr +else + $rootrun $TEXlsr --quiet +fi diff --git a/test/testing.sh b/test/testing.sh index 98db364..6b17e7a 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -44,7 +44,7 @@ check_trackschematic() { # check for tikz-trackschematic status=0 TEXMFLOCAL=$(kpsewhich --var-value TEXMFLOCAL) - DEVDIR="tex/latex/tikz-trackschematic-dev" + DEVDIR="tex/latex/local/tikz-trackschematic-dev" ls $TEXMFLOCAL/$DEVDIR/tikz-trackschematic.sty >> /dev/null 2>&1 || status=1 if [ $status = 0 ]; then