fix build problems on linux

This commit is contained in:
yuanchuan 2017-06-06 12:00:37 +08:00
parent efee1313fb
commit cd71c82ede
2 changed files with 17 additions and 1 deletions

View File

@ -8,7 +8,7 @@ all: build minify
build: $(LIB)
@npm run build
@sed -i "" $$'s/\t/ /' $(TARGET)
@./tools/tab2spaces
minify: $(TARGET)
@npm run minify

16
tools/tab2spaces Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const target = path.join(__dirname, '../css-doodle.js');
try {
const content = fs.readFileSync(target, 'utf8')
.replace(/\t/g, ' ')
if (content) {
fs.writeFileSync(target, content, 'utf8');
}
} catch (e) {
// it's ok
}