Skip to content

Commit

Permalink
fix paths in setup script, resolves #10
Browse files Browse the repository at this point in the history
  • Loading branch information
ericalli committed Jun 15, 2019
1 parent 58e3cf3 commit 1085732
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions config/site.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable */
const path = require('path');
const fs = require('fs');
const chalk = require('chalk');
const clear = require('clear');
Expand All @@ -8,6 +9,12 @@ const { prompt } = require('enquirer');

const skip_setup = process.env.SKIP_SETUP || false;

let ROOT = process.env.PWD;

if (!ROOT) {
ROOT = process.cwd();
}

async function runSetup() {
clear();
console.log(
Expand Down Expand Up @@ -70,7 +77,7 @@ async function runSetup() {
data = data.replace(/googleAnalyticsUA: '.*?'/g, `googleAnalyticsUA: '${questions.google_analytics}'`);
}

fs.writeFile('./config/site.config.js', data, 'utf8', (err) => { });
fs.writeFile(path.join(ROOT, '/config/site.config.js'), data, 'utf8', (err) => { });
});

// Add CSS reset to stylesheet
Expand All @@ -79,7 +86,7 @@ async function runSetup() {
'// Load CSS Reset from NPM\n'
+ '@import "~' + questions.cssreset + '"\n';

fs.writeFile('./../src/stylesheets/styles.scss', cssContent, (err) => {});
fs.writeFile(path.join(ROOT, '/src/stylesheets/styles.scss'), cssContent, (err) => {});
}

// Add jQuery to scripts
Expand All @@ -90,7 +97,7 @@ async function runSetup() {
+ 'window.jQuery = $;\n'
+ 'window.$ = $;\n';

fs.writeFile('./../src/javascripts/scripts.js', jsContent, (err) => {});
fs.writeFile(path.join(ROOT, '/src/javascripts/scripts.js'), jsContent, (err) => {});
}
};

Expand Down

0 comments on commit 1085732

Please sign in to comment.