Skip to content
Snippets Groups Projects
Commit 46ab9314 authored by ezsh's avatar ezsh
Browse files

Add a script to collect .css file content for Twine

parent b1cb39b1
No related branches found
No related tags found
1 merge request!4273Add a script to collect .css file content for Twine
@echo off
:: Generates devNotes/twineCSS.txt from all .css files in src/ subdir
:: See if we can find a git installation
setlocal enabledelayedexpansion
for %%k in (HKCU HKLM) do (
for %%w in (\ \Wow6432Node\) do (
for /f "skip=2 delims=: tokens=1*" %%a in ('reg query "%%k\SOFTWARE%%wMicrosoft\Windows\CurrentVersion\Uninstall\Git_is1" /v InstallLocation 2^> nul') do (
for /f "tokens=3" %%z in ("%%a") do (
set GIT=%%z:%%b
set GITFOUND=yes
goto FOUND
)
)
)
)
:FOUND
if %GITFOUND% == yes (
set "PATH=%GIT%bin;%PATH%"
bash --login -c ./makeTwineCSSPassage.sh
)
#!/bin/sh
# Generates devNotes/twine CSS.txt from all .css files in src/ subdir
# Joins all .css files from the current dir (recursive) into a Twee [script] passage
# arguments:
# $1: root repo dir
# $2: output file name
collectCSSForTwine() {
local files=$(find . -iname '*.css' -print)
files=$(echo "$files" | sort)
echo "" > "$2"
for f in $files; do
echo -e "\n/* ${f} */\n" >> "$2"
cat "$f" >> "$2"
done
}
ROOT_REPO_DIR="$(git rev-parse --show-toplevel)"
cd "${ROOT_REPO_DIR}"/src
collectCSSForTwine "${ROOT_REPO_DIR}" "${ROOT_REPO_DIR}/devNotes/twine CSS.txt"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment