Comparing version 0.1.2 to 0.1.3
23
index.js
@@ -20,9 +20,24 @@ #!/usr/bin/env node | ||
shell.exec('git checkout -'); | ||
var repoInfo = shell.exec('git remote show -n origin', {silent: true}) | ||
// Figure out the user and project name for this repo. | ||
var url = shell.exec('git remote show -n origin', {silent: true}) | ||
.grep('Push') | ||
.match(/https:..github.com\/([^./]+)\/([^./]+).*/); | ||
.replace(/^\s+Push\s+URL:\s+/, '') | ||
.trim(); | ||
var repoInfo; | ||
if (url.match(/^https/)) { | ||
repoInfo = url.match(/https:..github.com\/([^./]+)\/([^./]+).*/); | ||
} else if (url.match(/^git/)) { | ||
repoInfo = url.match(/git@github.com:([^/]+)\/([^.]+)\..*/); | ||
} else { | ||
console.warn('Unknown origin pattern: "' + url + '"'); | ||
shell.exit(0); | ||
} | ||
if (repoInfo) { | ||
shell.echo(['Deployed to https://', repoInfo[1], '.github.io/', repoInfo[2] ,'/'].join('')); | ||
var user = repoInfo[1]; | ||
var project = repoInfo[2]; | ||
shell.echo(['Deployed to https://', user, '.github.io/', project, '/'].join('')); | ||
} else { | ||
shell.echo('Unable to figure out repo name'); | ||
console.warn('Unable to figure out repo name: '); | ||
} |
{ | ||
"name": "deploy-gh", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A simple script to deploy master branch to github pages", | ||
@@ -11,5 +11,5 @@ "main": "index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"release:major": "release major", | ||
"release:minor": "release minor", | ||
"release:patch": "release patch", | ||
"release:major": "shelljs-release major", | ||
"release:minor": "shelljs-release minor", | ||
"release:patch": "shelljs-release patch", | ||
"deploy": "node index.js" | ||
@@ -31,4 +31,4 @@ }, | ||
"devDependencies": { | ||
"shelljs-release": "github:shelljs/release" | ||
"shelljs-release": "^0.3.0" | ||
} | ||
} |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
3662
4
37
1
31