File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,9 +10,10 @@ module.exports = async function upload(directory, args) {
1010 if ( directory && typeof directory === "string" ) {
1111 if ( [ "-w" , "--watch" ] . includes ( directory ) ) {
1212 isWatch = true ;
13- directory = process . cwd ( ) ;
1413 }
15- } else directory = process . cwd ( ) ;
14+ }
15+
16+ directory = process . cwd ( ) ;
1617
1718 if ( isWatch || args . includes ( "-w" ) || args . includes ( "--watch" ) ) {
1819 for ( let i = 0 ; i < args . length ; i ++ ) {
@@ -52,6 +53,7 @@ module.exports = async function upload(directory, args) {
5253 }
5354 } else {
5455 for ( let arg of args ) {
56+ arg = path . resolve ( directory , arg ) ;
5557 let CoCreateConfig ;
5658
5759 try {
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ const path = require("path");
33
44async function getConfig ( directory , filename = "CoCreate.config.js" ) {
55 let config ;
6- const filePath = path . resolve ( directory , filename ) ;
7- if ( ! filePath . includes ( "node_modules/" ) ) {
8- const configPath = findClosestConfig ( filePath , "CoCreate.config.js" ) ;
6+ let configPath = path . resolve ( directory , filename ) ;
7+ if ( ! configPath . includes ( "node_modules/" ) ) {
8+ configPath = findClosestConfig ( configPath , "CoCreate.config.js" ) ;
99 if ( configPath ) {
1010 config = require ( configPath ) ;
1111 config . configPath = configPath ;
12- config . filePath = filePath ;
12+ config . filePath = directory ;
1313 } else {
1414 console . log ( "No CoCreate.config file found in parent directories." ) ;
1515 }
You can’t perform that action at this time.
0 commit comments