mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-03 21:58:59 +00:00
Cleanup objj arguments story. objj-executable and "objj path/to/main.j" are now consistent.
This commit is contained in:
1 parent
8e87a4a941
commit
ee5817e480
3 files changed
+14
-13
No files matched your search
@@ -112,6 +112,13 @@ exports.run = function(args)
|
||||
{
|
||||
if (args && args.length > 1)
|
||||
{
|
||||
// we expect args to be in the format:
|
||||
// 1) "objj" path
|
||||
// 2) optional "-I" args
|
||||
// 3) real or "virtual" main.j
|
||||
// 4) optional program arguments
|
||||
|
||||
// copy the args since we're going to modify them
|
||||
var argv = args.slice(1);
|
||||
|
||||
while (argv.length && argv[0].indexOf('-I') === 0)
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
#!/usr/bin/env narwhal
|
||||
|
||||
var FILE = require("file");
|
||||
var execPath = require("file").path(module.path);
|
||||
var mainPath = execPath.dirname().dirname().join("lib", execPath.basename(), "main.j");
|
||||
|
||||
var cappuccinoPackage = FILE.path(module.path).dirname().dirname();
|
||||
var mainPath = cappuccinoPackage.join("lib", FILE.basename(module.path), "main.j");
|
||||
var frameworksPath = cappuccinoPackage.join("Frameworks");
|
||||
|
||||
// TODO: is specifying the Frameworks necessary?
|
||||
system.args.splice(1, 0, "-I"+frameworksPath, String(mainPath));
|
||||
|
||||
// HACK: remove use of SELF_HOME from capp gen
|
||||
system.env["SELF_HOME"] = cappuccinoPackage;
|
||||
|
||||
require("objective-j").run(system.args);
|
||||
var args = ["objj", String(mainPath)].concat(system.args.slice(1));
|
||||
require("objective-j").run(args);
|
||||
@@ -6,6 +6,8 @@ var OS = require("os"),
|
||||
FILE = require("file"),
|
||||
OBJJ = require("objective-j");
|
||||
|
||||
// FIXME: better way to do this:
|
||||
var CAPP_HOME = require("packages").catalog["cappuccino"].directory;
|
||||
|
||||
function gen(/*va_args*/)
|
||||
{
|
||||
@@ -56,7 +58,7 @@ function gen(/*va_args*/)
|
||||
if (FILE.isAbsolute(template))
|
||||
sourceTemplate = FILE.join(template);
|
||||
else
|
||||
sourceTemplate = FILE.join(SYSTEM.env["SELF_HOME"], "lib", "capp", "Resources", "Templates", template);
|
||||
sourceTemplate = FILE.join(CAPP_HOME, "lib", "capp", "Resources", "Templates", template);
|
||||
|
||||
var configFile = FILE.join(sourceTemplate, "template.config"),
|
||||
config = {};
|
||||
|
||||
Reference in new issue
Block a user