diff --git a/Makefile b/Makefile index 77bd2fe..394953a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ all: build minify build: $(LIB) @npm run build - @sed -i "" $$'s/\t/ /' $(TARGET) + @./tools/tab2spaces minify: $(TARGET) @npm run minify diff --git a/tools/tab2spaces b/tools/tab2spaces new file mode 100755 index 0000000..f5fa754 --- /dev/null +++ b/tools/tab2spaces @@ -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 +}