Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit fbcd8b9

Browse files
authored
Merge pull request #26 from serjxupypr/master
defined source path for WP projects
2 parents 2a24eb7 + f84a601 commit fbcd8b9

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

modules/behavior.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,12 @@ function finish() {
114114
* @function
115115
* @param {Object} conf - Information about git repositary and paths to files to delete
116116
*/
117-
function build(conf) {
117+
function build(conf, isWPforPug) {
118118
return new Promise((resolve, reject) => {
119119

120+
// define source path for WordPress projects or clean frontend projects (isWP_Path)
121+
let isWP_Path = isWPforPug == 'WordPress-With-Pug' ? 'assets' : 'src';
122+
120123
let chain = Promise.resolve();
121124

122125
for (var i = 0; i < conf.length; i++) {
@@ -168,7 +171,7 @@ function build(conf) {
168171
return new Promise((resolve, reject) => {
169172
vendor.changeVendor({
170173
config: config,
171-
path: './src/vendor_entries/vendor.scss',
174+
path: './'+isWP_Path+'/vendor_entries/vendor.scss',
172175
addVendor: vendor.addVendorScss,
173176
deleteVendor: vendor.deleteVendorScss
174177
})
@@ -181,7 +184,7 @@ function build(conf) {
181184
return new Promise((resolve, reject) => {
182185
vendor.changeVendor({
183186
config: config,
184-
path: './src/vendor_entries/vendor.js',
187+
path: './'+isWP_Path+'/vendor_entries/vendor.js',
185188
addVendor: vendor.addVendorJs,
186189
deleteVendor: vendor.deleteVendorJs
187190
})
@@ -215,9 +218,9 @@ function build(conf) {
215218
* @param {Object} module.emoji - Emoji module
216219
*/
217220
module.exports = {
218-
init: function (conf) {
221+
init: function (conf, isWPforPug) {
219222
console.log('\nGetting starter files... ' + emoji.get('runner'));
220-
build(conf);
223+
build(conf, isWPforPug);
221224
},
222225
emoji: emoji
223226
}

modules/questions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ module.exports = () => {
165165
break;
166166
}
167167

168-
behavior.init(config);
168+
behavior.init(config, isWPforPug);
169169
})
170170
.catch(e => {
171171
console.log(e);

0 commit comments

Comments
 (0)