Skip to content

Commit

Permalink
add scripts/copy.js back
Browse files Browse the repository at this point in the history
  • Loading branch information
knowbody committed Jun 5, 2017
1 parent 3260bfb commit dd1201f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
node_modules

# build
src/**/*.js
.merlin
public/main.js
lib
.merlin

# logs
*.log
Expand Down
18 changes: 18 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# dependencies
node_modules

# build
src/**/*.js
.merlin
public/main.js
lib

# logs
*.log

# mac
.DS_Store

# vim
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
17 changes: 17 additions & 0 deletions src/scripts/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node

const fs = require('fs');
const path = require('path');

const lower = name =>
path.basename(name).replace(/^./, letter => letter.toLowerCase());

const root = path.join(__dirname, '..');
const script = process.argv[2];
const output = script.replace(path.join(root, 'lib', 'js'), '');
const js = path.join(path.dirname(script), lower(script));

fs.writeFileSync(
path.join(root, path.dirname(output), lower(output)),
fs.readFileSync(js)
);

0 comments on commit dd1201f

Please sign in to comment.