fix(build): build.js 的 token 校验同样容忍 CRLF(与 gen-tokens 对齐)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 29s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 29s
This commit is contained in:
1 parent
f910f1c1bd
commit
f271ed014b
1 file changed
+2
-1
+2
-1
@@ -190,7 +190,8 @@ fs.writeFileSync(path.join(dist, 'app.js'), appBundle)
|
||||
const { build: buildTokens } = require('./gen-tokens')
|
||||
const tokensBuilt = buildTokens()
|
||||
const tokensCssPath = path.join(root, 'src/design-tokens.css')
|
||||
const tokensCss = fs.readFileSync(tokensCssPath, 'utf8')
|
||||
// Windows 检出可能是 CRLF(core.autocrlf=true):内容一致时不应让构建失败
|
||||
const tokensCss = fs.readFileSync(tokensCssPath, 'utf8').replace(/\r\n/g, '\n')
|
||||
if (tokensCss !== tokensBuilt.css) {
|
||||
console.error('FAIL src/design-tokens.css 与 src/theme-tokens.js 的 derive() 不一致')
|
||||
console.error(' → 先跑 npm run tokens:write(改了配色公式/种子却没重新生成快照)')
|
||||
|
||||
Reference in new issue
Block a user