Skip to content

Commit

Permalink
fix build on branches that contain slashes (like dependabot)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 6, 2023
1 parent 7642af5 commit 7c8f0c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CAT=cat
DATE=`date -uR`
GIT=LC_ALL=C git
BRANCH=`git branch | grep '^*' | sed 's/* //'`
BRANCH_SAFE=`git branch | grep '^*' | sed 's/* //' | sed 's/\//\\\\\//g'`
UGLIFY=../node_modules/.bin/uglifyjs
JSONLINT=./node_modules/.bin/jsonlint
JEST=./node_modules/.bin/jest
Expand Down Expand Up @@ -58,9 +59,9 @@ css/jquery.terminal-$(VERSION).min.css: css/jquery.terminal.min.css

README.md: templates/README.in .$(VERSION) __tests__/terminal.spec.js
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e \
"s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" \
"s/{{BRANCH}}/$(BRANCH_SAFE)/g" -e "s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" \
-e "s/{{COMMIT}}/$(COMMIT)/g" < templates/README.in > README.md || $(SED) -e \
"s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e \
"s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH_SAFE)/g" -e \
"s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" -e "s/{{COMMIT}}/$(COMMIT)/g" < templates/README.in > README.md

.$(VERSION): Makefile
Expand Down
5 changes: 3 additions & 2 deletions templates/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CAT=cat
DATE=`date -uR`
GIT=LC_ALL=C git
BRANCH=`git branch | grep '^*' | sed 's/* //'`
BRANCH_SAFE=`git branch | grep '^*' | sed 's/* //' | sed 's/\//\\\\\//g'`
UGLIFY=../node_modules/.bin/uglifyjs
JSONLINT=./node_modules/.bin/jsonlint
JEST=./node_modules/.bin/jest
Expand Down Expand Up @@ -58,9 +59,9 @@ css/jquery.terminal-$(VERSION).min.css: css/jquery.terminal.min.css

README.md: templates/README.in .$(VERSION) __tests__/terminal.spec.js
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e \
"s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" \
"s/{{BRANCH}}/$(BRANCH_SAFE)/g" -e "s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" \
-e "s/{{COMMIT}}/$(COMMIT)/g" < templates/README.in > README.md || $(SED) -e \
"s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e \
"s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH_SAFE)/g" -e \
"s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" -e "s/{{COMMIT}}/$(COMMIT)/g" < templates/README.in > README.md

.$(VERSION): Makefile
Expand Down

0 comments on commit 7c8f0c6

Please sign in to comment.