Skip to content

Commit 40d1ae7

Browse files
committed
add link
1 parent a016dd2 commit 40d1ae7

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
node_modules
1+
node_modules*
22
*.log
33
public/upload/*
44
public/html/*

bin/link.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env node
2+
3+
var current_path = process.cwd();
4+
// console.log(__dirname)
5+
6+
var dirw = require('dirw');
7+
8+
var dest_path = 'node_modules2';
9+
10+
function main(){
11+
var root = __dirname.split('/')
12+
root.pop();
13+
14+
var root_path = root.join('/')
15+
16+
dirw.dir(root_path + '/node_modules', function(dir, dir_name){
17+
if(dir_name == 'bin' || dir_name == '.bin'){
18+
return;
19+
}
20+
21+
_create_symlink(dir, dir_name)
22+
});
23+
}
24+
25+
function _create_symlink(dir, dir_name) {
26+
var link = require('fs-symlink')
27+
28+
link(dir, dest_path + '/' + dir_name, 'junction').then(function () {
29+
console.log('copy modudle ' + dir_name + ' finished');
30+
})
31+
}
32+
33+
main();

package.json

+33-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
},
1313
"preferGlobal": "true",
1414
"bin": {
15-
"moag": "bin/moag.js",
16-
"moad": "bin/moad.js",
17-
"moan": "bin/moan.js"
15+
"moag" : "bin/moag.js",
16+
"moad" : "bin/moad.js",
17+
"moan" : "bin/moan.js",
18+
"moalink" : "bin/link.js"
1819
},
1920
"repository": {
2021
"type": "git",
@@ -27,10 +28,39 @@
2728
},
2829
"homepage": "https://github.com/moajs/moa#readme",
2930
"dependencies": {
31+
"bluebird": "^2.9.27",
32+
"body-parser": "~1.12.4",
33+
"config": "^1.14.0",
34+
"connect-mongo": "^0.8.1",
35+
"cookie-parser": "~1.3.5",
36+
"cors": "^2.7.1",
37+
"debug": "~2.2.0",
38+
"dirw": "^1.0.2",
39+
"express": "~4.12.4",
40+
"express-di": "^4.1.1",
41+
"express-session": "^1.11.2",
3042
"fs-symlink": "^1.1.3",
3143
"inflected": "^1.1.6",
44+
"is_js": "^0.7.4",
45+
"jade": "~1.9.2",
46+
"jsonwebtoken": "^5.0.1",
47+
"log4js": "^0.6.25",
3248
"mkdirp": "^0.5.1",
49+
"moa-middlewares": "^1.0.2",
3350
"moment": "^2.10.3",
51+
"mongoose": "^4.0.4",
52+
"mongoosedao": "^1.0.6",
53+
"morgan": "~1.5.3",
54+
"mount-controllers": "^1.0.3",
55+
"mount-middlewares": "^1.0.1",
56+
"mount-models": "^1.0.3",
57+
"mount-routes": "^1.0.3",
58+
"mount-services": "^1.0.4",
59+
"multer": "^0.1.8",
60+
"nodemailer": "^1.3.4",
61+
"pm2": "^0.12.15",
62+
"require-directory": "^2.1.1",
63+
"serve-favicon": "~2.2.1",
3464
"shelljs": "^0.5.0",
3565
"tpl_apply": "^1.0.2"
3666
},

0 commit comments

Comments
 (0)