Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bundled Jake dependency, sepearated build from install task, started …

…work on resource controller template.
  • Loading branch information...
commit fa906c32a4e708f2460475907b9347700f778507 1 parent 91599f5
mde authored
12 Makefile
View
@@ -1,13 +1,13 @@
-.PHONY: all install
+.PHONY: all build install clean
-all: install
+all: build
-#install:
-# mkdir -p ~/.node_libraries/geddy; cp -R lib ~/.node_libraries/geddy/; cp -R scripts ~/.node_libraries/geddy/; cp scripts/geddy-gen /usr/local/bin/; cp scripts/geddy /usr/local/bin/
+build:
+ @mkdir -p ./dist; cp -r -t dist lib scripts; echo 'Geddy built.'
install:
- mkdir -p ~/.node_libraries/jake; cp ./scripts/jake.js ~/.node_libraries/jake/; cp ./scripts/jake /usr/local/bin; jake -f `pwd`/scripts/Jakefile default asdf:ASDF, foo=bar
+ @./scripts/jake -f `pwd`/scripts/Jakefile default
clean:
- rm -fr ~/.node_libraries/geddy; rm /usr/local/bin/geddy*
+ @rm -fr dist; rm -fr ~/.node_libraries/geddy; rm -f /usr/local/bin/geddy*; echo 'Geddy uninstalled.'
25 scripts/Jakefile.js
View
@@ -3,24 +3,25 @@ var sys = require('sys');
exports.tasks = {
'default': {
'desc': 'Installs the Geddy Web-app development framework',
+ 'deps': [],
'task': function (env) {
- sys.puts('Installing Geddy ...');
var cmds = [
'mkdir -p ~/.node_libraries/geddy',
- 'cp -R lib ~/.node_libraries/geddy/',
- 'cp -R scripts ~/.node_libraries/geddy/',
+ 'cp -R ./dist/* ~/.node_libraries/geddy/',
'cp scripts/geddy-gen /usr/local/bin/',
'cp scripts/geddy /usr/local/bin/'
];
- runCmds(cmds);
+ runCmds(cmds, function () {
+ sys.puts('Geddy installed.');
+ });
}
},
'app': {
'desc': 'Creates a new Geddy app scaffold.',
+ 'deps': [],
'task': function (env) {
var dir = env.appName;
- sys.puts('Creating app ' + dir);
var cmds = [
'mkdir -p ./' + dir,
'mkdir -p ./' + dir + '/config',
@@ -29,13 +30,22 @@ exports.tasks = {
'cp ~/.node_libraries/geddy/scripts/gen/router.js ' + dir + '/config/',
'cp ~/.node_libraries/geddy/scripts/gen/main.js ' + dir + '/app/controllers/'
]
- runCmds(cmds);
+ runCmds(cmds, function () {
+ sys.puts('Created app ' + dir + '.');
+ });
}
+ },
+
+ 'resource': {
+
}
};
-var runCmds = function (arr) {
+// Runs an array of shell commands asynchronously, calling the
+// next command off the queue inside the callback from sys.exec.
+// When the queue is done, call the final callback function.
+var runCmds = function (arr, callback) {
var run = function (cmd) {
sys.exec(cmd, function (err, stdout, stderr) {
if (err) {
@@ -50,6 +60,7 @@ var runCmds = function (arr) {
run(next);
}
else {
+ callback();
}
}
});
2  scripts/geddy-gen
View
@@ -1,4 +1,4 @@
#!/bin/bash
-node ~/.node_libraries/jake/jake.js -f ~/.node_libraries/geddy/scripts/Jakefile $1 appName=$2
+node ~/.node_libraries/geddy/scripts/jake.js -f ~/.node_libraries/geddy/scripts/Jakefile $1 appName=$2
0  scripts/gen/users.js → scripts/gen/resource_controller.ejs
View
File renamed without changes
2  scripts/jake
View
@@ -1,4 +1,4 @@
#!/bin/bash
-node ~/.node_libraries/jake/jake.js $@
+node ./scripts/jake.js $@
1  scripts/jake.js
View
@@ -1,4 +1,3 @@
-var sys = require('sys');
var args = process.argv.slice(2);
var opts = {};
Please sign in to comment.
Something went wrong with that request. Please try again.