-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from carrot/es6
Convert to ES6
- Loading branch information
Showing
15 changed files
with
1,201 additions
and
1,520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015", "stage-2"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
build: | ||
cp -R lib src | ||
babel src --out-dir lib | ||
|
||
unbuild: | ||
rm -rf lib | ||
mv src lib | ||
|
||
publish: | ||
make build | ||
npm publish . | ||
make unbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import add from './add' | ||
import remove from './remove' | ||
import init from './init' | ||
import run from './run' | ||
|
||
export default { | ||
add: add, | ||
remove: remove, | ||
init: init, | ||
run: run | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
var Promise = require('bluebird') | ||
import Promise from 'bluebird' | ||
|
||
/* | ||
* Remove a template. | ||
* @param {Function} sprout - Sprout instance. | ||
* @param {String} name - name of template to remove. | ||
* @return {Promise} - Promise for Template instance. | ||
*/ | ||
|
||
module.exports = function (sprout, name) { | ||
var template = sprout.templates[name] | ||
export default function (sprout, name) { | ||
const template = sprout.templates[name] | ||
if (template) { | ||
return template.remove().then( | ||
function () { | ||
delete sprout.templates[name] | ||
} | ||
) | ||
return template.remove().then(() => { | ||
delete sprout.templates[name] | ||
}) | ||
} | ||
return Promise.reject(new Error('template ' + name + ' does not exist')) | ||
return Promise.reject(new Error(`template ${name} does not exist`)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
var isBinaryFile = require('isbinaryfile') | ||
import isBinary from 'isbinaryfile' | ||
|
||
/* | ||
* Determines whether a string is a | ||
* valid Git URL tests against a | ||
* regular expression. | ||
* Determines whether a string is a valid Git URL tests against a regular | ||
* expression. | ||
* @param {String} str - String to test | ||
* @return {Boolean} - is `str` a git URL | ||
*/ | ||
|
||
exports.isGitURL = function (str) { | ||
export function isGitUrl (str) { | ||
return /(?:[A-Za-z0-9]+@|https?:\/\/)[A-Za-z0-9.]+(?::|\/)[A-Za-z0-9\/]+(?:\.git)?/.test(str) | ||
} | ||
|
||
/* | ||
* A decent check to determine whether | ||
* a given file is a binary. | ||
* A decent check to determine whether a given file is a binary. | ||
* @param {Array} src - Path the file | ||
* @return {Boolean} - whether given file is binary | ||
*/ | ||
|
||
exports.isBinaryFile = function (src) { | ||
return isBinaryFile.sync(src) | ||
export function isBinaryFile (src) { | ||
return isBinary.sync(src) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.