mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
create package
This commit is contained in:
@@ -293,7 +293,7 @@ main.registerCommand({
|
||||
maxArgs: 1,
|
||||
options: {
|
||||
list: { type: Boolean },
|
||||
example: { type: String }
|
||||
example: { type: String },
|
||||
}
|
||||
}, function (options) {
|
||||
// Suppose you have an app A, and from some directory inside that
|
||||
@@ -392,6 +392,35 @@ main.registerCommand({
|
||||
" meteor\n");
|
||||
});
|
||||
|
||||
// For now, this literally drops a package into a directory.
|
||||
main.registerCommand({
|
||||
name: 'create-package',
|
||||
hidden: true,
|
||||
maxArgs: 1
|
||||
}, function (options) {
|
||||
|
||||
var appPath;
|
||||
if (options.args.length === 1)
|
||||
appPath = options.args[0];
|
||||
else if (options.example)
|
||||
appPath = options.example;
|
||||
else
|
||||
throw new main.ShowUsage;
|
||||
|
||||
if (fs.existsSync(appPath)) {
|
||||
process.stderr.write(appPath + ": Already exists\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
files.cp_r(path.join(__dirname, 'skel-pack'), appPath);
|
||||
|
||||
process.stderr.write(appPath + ": created");
|
||||
process.stderr.write(".\n\n");
|
||||
return 0;
|
||||
|
||||
});
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// update
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
1
tools/skel-pack/hello.js
Normal file
1
tools/skel-pack/hello.js
Normal file
@@ -0,0 +1 @@
|
||||
console.log("hello world");
|
||||
9
tools/skel-pack/package.js
Normal file
9
tools/skel-pack/package.js
Normal file
@@ -0,0 +1,9 @@
|
||||
Package.describe({
|
||||
summary: "Hello world!",
|
||||
version: "1.0.0",
|
||||
name: "hello"
|
||||
});
|
||||
|
||||
Package.on_use(function(api) {
|
||||
api.add_files('hello.js');
|
||||
});
|
||||
Reference in New Issue
Block a user