@@ -37,6 +37,7 @@ import {
3737 QWIK_UI_CONFIG_FILENAME ,
3838} from '../src/_shared/config-filenames' ;
3939
40+ import path from 'path' ;
4041import externalDeps from '../src/_shared/external-deps.json' ;
4142
4243const COMMANDS = [ 'init' , 'add' ] ;
@@ -162,9 +163,10 @@ async function handleInit() {
162163 if ( ! config . rootCssPath ) {
163164 config . rootCssPath = await collectFileLocationFromUser ( {
164165 message : cyan (
165- 'Your global css file location (where you defined your tailwind directives )' ,
166+ 'The path to the global css file the tailwind directives are defined (relative to root )' ,
166167 ) ,
167168 errorMessageName : 'Global css file' ,
169+ rootDir : config . projectRoot ,
168170 initialValue : 'src/global.css' ,
169171 } ) ;
170172 }
@@ -507,6 +509,7 @@ function parseCommands(command: CommandModule) {
507509interface FilePromptInfo {
508510 message : string ;
509511 errorMessageName : string ;
512+ rootDir : string ;
510513 initialValue ?: string ;
511514}
512515
@@ -517,9 +520,9 @@ async function collectFileLocationFromUser(config: FilePromptInfo) {
517520 initialValue : config . initialValue ,
518521 } ) ,
519522 ) ;
520-
521- if ( ! existsSync ( filePath ) ) {
522- log . error ( `${ config . errorMessageName } not found at ${ filePath } , want to try again?` ) ;
523+ const fullPath = path . join ( config . rootDir , filePath ) ;
524+ if ( ! existsSync ( fullPath ) ) {
525+ log . error ( `${ config . errorMessageName } not found at ${ fullPath } , want to try again?` ) ;
523526 return collectFileLocationFromUser ( { ...config , initialValue : filePath } ) ;
524527 }
525528 return filePath ;
0 commit comments