diff --git a/setup/migrate.js b/setup/migrate.js index 871c8158..c9ddd9d4 100644 --- a/setup/migrate.js +++ b/setup/migrate.js @@ -265,14 +265,6 @@ async function migrateSettings () { 'OAUTH_CLIENT_SECRET', 'GITHUB_PERSONAL_ACCESS_TOKEN' ] - const varsToImport = importableEnvVars.filter(name => !!process.env[name]) - if (!varsToImport.length) { - spinner.succeed('No environment variable to import') - return - } - else { - spinner.info(`Will import the following env vars: \n - ${varsToImport.map(x => `${x}=${process.env[x]}`).join('\n - ')}\n`) - } try { const client = knex({ @@ -295,6 +287,15 @@ async function migrateSettings () { if (!existingConfigs.length) { const { forge, editor, ontology } = getConfigFromEnvVars() + const varsToImport = importableEnvVars.filter(name => !!process.env[name]) + if (!varsToImport.length) { + spinner.succeed('No environment variable to import') + return + } + else { + spinner.info(`Will import the following env vars: \n - ${varsToImport.map(x => `${x}=${process.env[x]}`).join('\n - ')}\n`) + } + await client.raw(` INSERT INTO "editor_schema"."config"("forge", "editor", "ontology", "reason") diff --git a/setup/replace-vars.js b/setup/replace-vars.js index 2d2bc7f2..4989f0af 100644 --- a/setup/replace-vars.js +++ b/setup/replace-vars.js @@ -5,6 +5,7 @@ const path = require('path') const shell = require('child_process').execSync const dummyConfig = require('../fixtures/dummy-config') const fetchConfig = require('./fetch-config') +const debug = require('debug')('editor:entrypoint') module.exports = replace @@ -43,7 +44,7 @@ async function replace () { `) } catch (err) { - console.log(err.message) + debug(err.message) } } @@ -61,6 +62,7 @@ async function setManifest (manifest) { else { v = 0 } + debug(`new version: ?v=${v + 1}`) return `${filename}?v=${v + 1}` }) await fs.writeFile(