Comparing version 0.1.3 to 0.1.5
@@ -91,3 +91,3 @@ (function() { | ||
output.on('close', function() { | ||
console.log(archive.pointer() + ' total bytes'); | ||
console.log('\n', archive.pointer() + ' total bytes. Publishing...'); | ||
return deferred.resolve(archive.pointer()); | ||
@@ -94,0 +94,0 @@ }); |
@@ -25,14 +25,15 @@ (function() { | ||
MetadataFile.prototype.validateMetadata = function(meta) { | ||
var regex; | ||
if (meta['name'] == null) { | ||
throw new Error("Field \"name\" should be set in meta.json file"); | ||
throw new Error('Field \"name\" should be set in meta.json file'); | ||
} | ||
if (meta['version'] == null) { | ||
throw new Error("Field \"version\" should be set in meta.json file"); | ||
throw new Error('Field \"version\" should be set in meta.json file'); | ||
} | ||
if (meta['owner'] == null) { | ||
throw new Error("Field \"owner\" should be set in meta.json file"); | ||
throw new Error('Field \"owner\" should be set in meta.json file'); | ||
} | ||
regex = /^(\d+)\.(\d+)\.(\d+)(-.*)?$/; | ||
if (!(meta['version'].match(regex))) { | ||
if (!meta['owner'].match(/^[\w_-]+$/)) { | ||
throw new Error('Field \"owner\" may contain only letters, numbers, underscores and hyphens'); | ||
} | ||
if (!(meta['version'].match(/^(\d+)\.(\d+)\.(\d+)(-.*)?$/))) { | ||
throw Error('The version format is invalid'); | ||
@@ -39,0 +40,0 @@ } |
@@ -32,3 +32,3 @@ (function() { | ||
options = { | ||
url: "http://gallery.vtexlocal.com.br/" + owner + "/apps", | ||
url: "http://api.beta.vtex.com/" + owner + "/apps", | ||
method: 'POST', | ||
@@ -44,2 +44,3 @@ formData: formData, | ||
var body; | ||
fileManager.removeZipFile(app, version); | ||
if (response.statusCode === 200) { | ||
@@ -49,3 +50,3 @@ return console.log('\n', "App \'" + app + "\' version \'" + version + "\' was successfully published"); | ||
body = JSON.parse(response.body); | ||
return console.error('\n', ("Failed to publish app with status code " + response.statusCode + ": \'" + body.message + "\`").red); | ||
return console.error('\n', ("Failed to publish app with status code " + response.statusCode + ": \'" + body.message + "\'").red); | ||
} | ||
@@ -52,0 +53,0 @@ }); |
@@ -160,3 +160,3 @@ (function() { | ||
options = { | ||
url: "http://api.beta.vtex.com/gallery/sandbox/" + this.app + "/changes", | ||
url: "http://api.beta.vtex.com/" + this.owner + "/sandboxes/" + this.sandbox + "/" + this.app + "/files", | ||
method: 'POST', | ||
@@ -163,0 +163,0 @@ json: batchChanges, |
@@ -18,7 +18,11 @@ #!/usr/bin/env node | ||
auth.getValidCredentials().then(function(credentials) { | ||
var sandbox; | ||
sandbox = program.args.length ? program.args[0] : credentials.email; | ||
if (!program.args.length) { | ||
throw Error("Sandbox name is required. Use vtex watch <sandbox>".red); | ||
} | ||
if (!(program.args[0].match(/^[\w_-]+$/))) { | ||
throw Error('Sandbox may contain only letters, numbers, underscores and hyphens'.red); | ||
} | ||
return metadata.getAppMetadata().then(function(meta) { | ||
var watcher; | ||
watcher = new Watcher(meta.name, meta.owner, sandbox, credentials); | ||
watcher = new Watcher(meta.name, meta.owner, program.args[0], credentials); | ||
return watcher.watch(); | ||
@@ -25,0 +29,0 @@ }); |
{ | ||
"name": "vtex", | ||
"version": "0.1.3", | ||
"version": "0.1.5", | ||
"description": "CLI tool for creating and managing VTEX apps", | ||
@@ -5,0 +5,0 @@ "bin": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1406897
21
680