Skip to content

Commit 201bd23

Browse files
committed
fix: 🐛 add crossplatform prei18n-extract script
1 parent f50bcbd commit 201bd23

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"contracts:compile:v3": "typechain --target ethers-v5 --out-dir src/types/v3 \"./node_modules/@uniswap/**/artifacts/contracts/**/*.json\"",
167167
"contracts:compile": "yarn contracts:compile:abi && yarn contracts:compile:v3",
168168
"graphql:generate": "graphql-codegen --config codegen.yml",
169-
"prei18n:extract": "touch src/locales/en-US.po",
169+
"prei18n:extract": "node prei18n-extract.js",
170170
"i18n:extract": "lingui extract --locale en-US",
171171
"i18n:compile": "yarn i18n:extract && lingui compile",
172172
"i18n:pseudo": "lingui extract --locale pseudo && lingui compile",

prei18n-extract.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { exec } from 'child_process'
2+
const isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)
3+
4+
if (isWindows) {
5+
exec(`type nul > src/locales/en-US.po`)
6+
} else {
7+
exec(`touch src/locales/en-US.po`)
8+
}

0 commit comments

Comments
 (0)