This repository was archived by the owner on Jun 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 3838 "playground" : " npx http-server playground" ,
3939 "prepare" : " husky install" ,
4040 "prerelease" : " scripts/prerelease" ,
41- "prettier" : " prettier --plugin . --parser=liquid-html" ,
41+ "prettier" : " scripts/prettier" ,
42+ "prettier2" : " cross-env PRETTIER_MAJOR=2 scripts/prettier" ,
43+ "prettier3" : " cross-env PRETTIER_MAJOR=3 scripts/prettier" ,
4244 "test" : " node_modules/.bin/mocha '{src,test}/**/*.spec.ts'" ,
4345 "test:3" : " cross-env PRETTIER_MAJOR=3 yarn test" ,
4446 "test:idempotence" : " cross-env TEST_IDEMPOTENCE=true node_modules/.bin/mocha 'test/**/*.spec.ts'" ,
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ cleanup () {
4+ rm node_modules/prettier
5+ }
6+
7+ run () {
8+ echo " $@ "
9+ $@
10+ }
11+
12+ if [[ $PRETTIER_MAJOR = 3 ]]; then
13+ prettier=' ./prettier3'
14+ cmd=" ./node_modules/prettier3/bin/prettier.cjs --plugin ./dist/index.js --parser=liquid-html --ignore-path=.prettierignore"
15+ else
16+ prettier=' ./prettier2'
17+ cmd=" ./node_modules/prettier2/bin-prettier.js --plugin . --parser=liquid-html"
18+ fi
19+
20+ # format with prettier2
21+ ln -s $prettier node_modules/prettier
22+
23+ # cleanup when done
24+ trap cleanup EXIT
25+
26+ # run command for version
27+ run $cmd " $@ "
You can’t perform that action at this time.
0 commit comments