This repository was archived by the owner on Dec 4, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 876
chore: add firebase project name to prompt #2743
Merged
kwalrath
merged 1 commit into
angular:master
from
chalin:chalin-adjust-deploy-prompt-1102
Nov 4, 2016
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,6 +1,8 @@ | ||
{ | ||
"projects": { | ||
"live": "angular-io", | ||
"ngdocsdev": "ngdocsdev" | ||
"ngdocsdev": "ngdocsdev", | ||
"kw-dev": "kw-angular-io", | ||
"dev": "angular-io-dev" | ||
} | ||
} |
This file contains hidden or 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,75 +1,76 @@ | ||
{ | ||
"firebase": "angular-io", | ||
"public": "www", | ||
"rewrites": [ | ||
{ | ||
"source": "/docs/dart/latest/testing", | ||
"destination":"/docs/dart/latest/guide/testing.html" | ||
}, | ||
{ | ||
"source": "/docs/dart/latest/tutorial", | ||
"destination": "/docs/dart/latest/index.html" | ||
}, | ||
{ | ||
"source": "/docs/js/latest/testing", | ||
"destination": "/docs/js/latest/guide/testing.html" | ||
}, | ||
{ | ||
"source": "/docs/js/latest/tutorial", | ||
"destination": "/docs/js/latest/index.html" | ||
}, | ||
{ | ||
"source": "/docs/ts/latest/guide/setup.html", | ||
"destination": "/docs/ts/latest/index.html" | ||
}, | ||
{ | ||
"source": "/docs/ts/latest/testing", | ||
"destination": "/docs/ts/latest/guide/testing.html" | ||
}, | ||
{ | ||
"source": "/cheatsheet", | ||
"destination": "/docs/ts/latest/guide/cheatsheet.html" | ||
}, | ||
{ | ||
"source": "/cheatsheet.json", | ||
"destination": "/docs/ts/latest/guide/cheatsheet.json" | ||
}, | ||
{ | ||
"source": "/AngularCheatSheet_Letter.pdf", | ||
"destination": "/docs/ts/latest/guide/AngularCheatSheet_Letter.pdf" | ||
}, | ||
{ | ||
"source": "/AngularCheatSheet_Poster.pdf", | ||
"destination": "/docs/ts/latest/guide/AngularCheatSheet_Poster.pdf" | ||
}, | ||
{ | ||
"source": "/cardboard", | ||
"destination": "/cardboard/index.html" | ||
}, | ||
{ | ||
"source": "/license", | ||
"destination": "/license.txt" | ||
}, | ||
{ | ||
"source": "/events", | ||
"destination": "/events.html" | ||
}, | ||
{ | ||
"source": "/survey", | ||
"destination": "/survey.html" | ||
}, | ||
{ | ||
"source": "/dart", | ||
"destination": "/docs/dart/latest/index.html" | ||
}, | ||
{ | ||
"source": "/styleguide", | ||
"destination": "/docs/ts/latest/guide/style-guide.html" | ||
} | ||
], | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
] | ||
} | ||
"hosting": { | ||
"public": "www", | ||
"rewrites": [ | ||
{ | ||
"source": "/docs/dart/latest/testing", | ||
"destination": "/docs/dart/latest/guide/testing.html" | ||
}, | ||
{ | ||
"source": "/docs/dart/latest/tutorial", | ||
"destination": "/docs/dart/latest/index.html" | ||
}, | ||
{ | ||
"source": "/docs/js/latest/testing", | ||
"destination": "/docs/js/latest/guide/testing.html" | ||
}, | ||
{ | ||
"source": "/docs/js/latest/tutorial", | ||
"destination": "/docs/js/latest/index.html" | ||
}, | ||
{ | ||
"source": "/docs/ts/latest/guide/setup.html", | ||
"destination": "/docs/ts/latest/index.html" | ||
}, | ||
{ | ||
"source": "/docs/ts/latest/testing", | ||
"destination": "/docs/ts/latest/guide/testing.html" | ||
}, | ||
{ | ||
"source": "/cheatsheet", | ||
"destination": "/docs/ts/latest/guide/cheatsheet.html" | ||
}, | ||
{ | ||
"source": "/cheatsheet.json", | ||
"destination": "/docs/ts/latest/guide/cheatsheet.json" | ||
}, | ||
{ | ||
"source": "/AngularCheatSheet_Letter.pdf", | ||
"destination": "/docs/ts/latest/guide/AngularCheatSheet_Letter.pdf" | ||
}, | ||
{ | ||
"source": "/AngularCheatSheet_Poster.pdf", | ||
"destination": "/docs/ts/latest/guide/AngularCheatSheet_Poster.pdf" | ||
}, | ||
{ | ||
"source": "/cardboard", | ||
"destination": "/cardboard/index.html" | ||
}, | ||
{ | ||
"source": "/license", | ||
"destination": "/license.txt" | ||
}, | ||
{ | ||
"source": "/events", | ||
"destination": "/events.html" | ||
}, | ||
{ | ||
"source": "/survey", | ||
"destination": "/survey.html" | ||
}, | ||
{ | ||
"source": "/dart", | ||
"destination": "/docs/dart/latest/index.html" | ||
}, | ||
{ | ||
"source": "/styleguide", | ||
"destination": "/docs/ts/latest/guide/style-guide.html" | ||
} | ||
], | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
] | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -14,6 +14,7 @@ var fsExtra = require('fs-extra'); | |
var fs = fsExtra; | ||
var exec = require('child_process').exec; | ||
var execPromise = Q.denodeify(exec); | ||
var execSync = require('child_process').execSync; | ||
// cross platform version of spawn that also works on windows. | ||
var xSpawn = require('cross-spawn'); | ||
var prompt = require('prompt'); | ||
|
@@ -744,7 +745,7 @@ gulp.task('build-compile', ['build-docs'], function() { | |
return harpCompile(); | ||
}); | ||
|
||
gulp.task('check-deploy', ['build-docs'], function() { | ||
gulp.task('check-deploy', ['firebase-use-proj-check', 'build-docs'], () => { | ||
return harpCompile().then(function() { | ||
gutil.log('compile ok'); | ||
gutil.log('running live server ...'); | ||
|
@@ -753,7 +754,7 @@ gulp.task('check-deploy', ['build-docs'], function() { | |
}).then(function(shouldDeploy) { | ||
if (shouldDeploy) { | ||
gutil.log('deploying...'); | ||
return execPromise('firebase deploy'); | ||
return execPromise(`firebase deploy -p ${WWW}`); | ||
} else { | ||
return ['Not deploying']; | ||
} | ||
|
@@ -764,6 +765,17 @@ gulp.task('check-deploy', ['build-docs'], function() { | |
}); | ||
}); | ||
|
||
gulp.task('firebase-use-proj-check', cb => { | ||
try { | ||
execSync('firebase use'); | ||
} catch (e) { | ||
// Rerun command so user gets project + alias info | ||
execSync('firebase use', {stdio:[0,1,2]}); | ||
throw `\nAborting: no firebase project selected. Run:\n\n firebase use <project-or-alias-name>\n\n`; | ||
} | ||
return cb(); | ||
}); | ||
|
||
gulp.task('test-api-builder', function (cb) { | ||
execCommands(['npm run test-api-builder'], {}, cb); | ||
}); | ||
|
@@ -1071,7 +1083,6 @@ function backupApiHtmlFilesExist(folderName) { | |
} | ||
|
||
function harpJsonSetJade2NgTo(v) { | ||
const execSync = require('child_process').execSync; | ||
const harpJsonPath = path.join(ANGULAR_IO_PROJECT_PATH, 'harp.json'); | ||
execSync(`perl -pi -e 's/("jade2ng": *)\\w+/$1${v}/' ${harpJsonPath}`); | ||
const harpJson = require(harpJsonPath); | ||
|
@@ -1204,10 +1215,12 @@ function watchAndSync(options, cb) { | |
|
||
// returns a promise; | ||
function askDeploy() { | ||
// Show user what the currently active firebase project is: | ||
execSync('firebase use', {stdio:[0,1,2]}); | ||
prompt.start(); | ||
var schema = { | ||
name: 'shouldDeploy', | ||
description: 'Deploy to Firebase? (y/n)', | ||
description: `Deploy ${WWW} to firebase? (y/n)`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. back ticks are really valid here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, its TS syntax for a string with interpolation (i.e., the ${WWW} inside the string). |
||
type: 'string', | ||
pattern: /Y|N|y|n/, | ||
message: "Respond with either a 'y' or 'n'", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a little help on how to get the project-or-alias-name? Or an example of a name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what line 773 does. It generates output like:
Is that good enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's great.