-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathgenerate.js
More file actions
42 lines (42 loc) · 1.12 KB
/
Copy pathgenerate.js
File metadata and controls
42 lines (42 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Generated by LiveScript 1.3.1
(function(){
var fs, glob, p, isFile, updateJson, files;
fs = require('fs');
glob = require('glob');
p = require('prelude-ls');
isFile = function(name){
return fs.existsSync(name) && fs.lstatSync(name).isFile();
};
updateJson = function(path, update){
var file, save, json;
file = isFile(path)
? require(path)
: {};
save = function(){
return fs.writeFileSync(path, json, 'utf8');
};
update(file, save);
json = JSON.stringify(file, null, 4);
return save();
};
files = glob.sync('compiled-commands/*');
updateJson('./package.json', function(model){
var name, ref, names;
name = function(filename){
return filename.match("([a-z]+).[^.]+$")[1];
};
ref = function(it){
return "./refs/" + it;
};
names = p.map(name)(
files);
names.forEach(function(it){
return fs.writeFileSync(ref(it), "#!/usr/bin/env node\nrequire('../nixar.js')('" + it + "')", 'utf8');
});
return model.bin = p.pairsToObj(
p.map(function(it){
return [it, ref(it)];
})(
names));
});
}).call(this);