Commits

Anonymous committed 6f9cf57

Initial commit

  • Participants

Comments (0)

Files changed (7)

+.DS_Store
+node_modules
+# bbdev
+
+BlackBerry development helper tool.
+#!/usr/bin/env node
+require('scaffolder')({
+    defaultCommands: ['build']
+});

File lib/commands/build.js

+exports.desc = 'Build the current project';
+
+exports.args = {
+};
+
+// export runner
+exports.run = function(opts, callback) {
+};

File lib/commands/config-set.js

+exports.desc = 'Set bbdev configuration parameter';
+
+exports.run = function(opts, callback) {
+    var args = opts.argv.remain;
+
+    // if we only have one argument, split on =
+    if (args.length === 1) {
+        args = args[0].split('=');
+    }
+
+    console.log(args);
+};

File lib/config.js

+var path = require('path'),
+    _ = require('underscore'),
+    homePath = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'],
+    configFile = path.resolve(homePath, '.bbdev'),
+
+    defaultConfig = {
+        deviceIp: '169.254.0.1'
+    },
+
+    config;
+
+// load the configuration from the home directory
+exports.load = function(callback) {
+    // if the configuration is already loaded, then return it immediately
+    if (config) return callback(config);
+
+    // load the configuration file
+    fs.readFile(configFile, 'utf8', function(err, data) {
+        // initialise the config
+        try {
+            config = JSON.parse(data || '{}');
+        }
+        catch (e) {
+            config = {};
+        }
+
+        // apply defaults to the config and trigger the callback
+        callback(_.defaults(config, defaultConfig));
+    });
+};

File package.json

+{
+  "name": "worx",
+  "description": "BlackBerry Webworks Dev Helper",
+  "author": "Damon Oehlman <damon.oehlman@sidelab.com>",
+  "tags": ["blackberry", "webworks"],
+  "version": "0.0.0",
+  "bin": {
+    "worx": "./bin/worx"
+  },
+  "engines": {
+    "node": ">= 0.8.x < 0.9.0"
+  },
+  "dependencies": {
+    "scaffolder": "0.7.x",
+    "taskify": "0.5.x",
+    "underscore": "1.4.x"
+  },
+  "devDependencies": {
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/DamonOehlman/bbdev.git"
+  },
+  "bugs": {
+    "url": "http://github.com/DamonOehlman/bbdev/issues"
+  },
+  "contributors": []
+}