Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-yx committed May 8, 2019
1 parent 9e76272 commit e2c36cc
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
4 changes: 1 addition & 3 deletions src/commands/functions/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ async function pickTemplate() {
function ensureFunctionDirExists(flags, config) {
const functionsDir = config.build && config.build.functions;
if (!functionsDir) {
this.log(
`${NETLIFYDEVLOG} No functions folder specified in netlify.toml`
);
this.log(`${NETLIFYDEVLOG} No functions folder specified in netlify.toml`);
process.exit(1);
}
if (!fs.existsSync(functionsDir)) {
Expand Down
4 changes: 2 additions & 2 deletions src/detectors/quasar-v0.17.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function() {
if (!hasRequiredDeps(["quasar-cli"])) return false;

/** everything below now assumes that we are within Quasar */

const possibleArgsArrs = scanScripts({
preferredScriptsArr: ["serve", "start", "run", "dev"]
// NOTE: this is comented out as it was picking this up in cordova related scripts.
Expand All @@ -34,4 +34,4 @@ module.exports = function() {
urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, "g"),
dist: ".quasar"
};
};
};
4 changes: 2 additions & 2 deletions src/detectors/quasar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function() {
if (!hasRequiredDeps(["@quasar/app"])) return false;

/** everything below now assumes that we are within Quasar */

const possibleArgsArrs = scanScripts({
preferredScriptsArr: ["serve", "start", "run", "dev"]
// NOTE: this is comented out as it was picking this up in cordova related scripts.
Expand All @@ -34,4 +34,4 @@ module.exports = function() {
urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, "g"),
dist: ".quasar"
};
};
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
name: 'auth-fetch',
description: 'Use `node-fetch` library and Netlify Identity to access APIs',
name: "auth-fetch",
description: "Use `node-fetch` library and Netlify Identity to access APIs",
onComplete() {
console.log(`auth-fetch function created from template!`)
console.log(`auth-fetch function created from template!`);
console.log(
'REMINDER: Make sure to call this function with the Netlify Identity JWT. See https://netlify-gotrue-in-react.netlify.com/ for demo'
)
"REMINDER: Make sure to call this function with the Netlify Identity JWT. See https://netlify-gotrue-in-react.netlify.com/ for demo"
);
}
}
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
name: 'hello-world',
name: "hello-world",
priority: 1,
description: 'Basic function that shows async/await usage, and response formatting'
}
description:
"Basic function that shows async/await usage, and response formatting"
};
7 changes: 5 additions & 2 deletions src/functions-templates/js/identity-signup/identity-signup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// note - this function MUST be named `identity-signup` to work
// we do not yet offer local emulation of this functionality in Netlify Dev
//
// more:
// more:
// https://www.netlify.com/blog/2019/02/21/the-role-of-roles-and-how-to-set-them-in-netlify-identity/
// https://www.netlify.com/docs/functions/#identity-and-functions

Expand All @@ -11,7 +11,10 @@ exports.handler = async function(event, context) {

const responseBody = {
app_metadata: {
roles: user.email.split("@")[1] === "trust-this-company.com" ? ["editor"] : ["visitor"];,
roles:
user.email.split("@")[1] === "trust-this-company.com"
? ["editor"]
: ["visitor"],
my_user_info: "this is some user info"
},
user_metadata: {
Expand Down

0 comments on commit e2c36cc

Please sign in to comment.