Commit a3026e1 1 parent 3c74ce8 commit a3026e1 Copy full SHA for a3026e1
File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 46
46
"lint" : " yarn lint:eslint && yarn lint:ts" ,
47
47
"lint:eslint" : " npx eslint bin/*.js src/*.ts --cache --fix" ,
48
48
"lint:ts" : " npx tsc -p tsconfig.build.json --noEmit" ,
49
- "prepublishOnly " : " yarn build" ,
49
+ "prepack " : " yarn build" ,
50
50
"release" : " source .env && npx semantic-release --color --no-ci"
51
51
},
52
52
"husky" : {
Original file line number Diff line number Diff line change @@ -111,10 +111,11 @@ export class Cli {
111
111
}
112
112
113
113
gitRoot ( cwd = process . cwd ( ) ) : string | undefined {
114
- if ( cwd == "/" ) return undefined
115
- const p = path . posix . resolve ( cwd , "./.git" )
114
+ const p = path . resolve ( cwd , "./.git" )
116
115
if ( fs . existsSync ( p ) && fs . lstatSync ( p ) . isDirectory ( ) ) return p
117
- return this . gitRoot ( path . resolve ( cwd , "../" ) )
116
+ const up = path . resolve ( cwd , "../" )
117
+ if ( up == cwd ) return
118
+ return this . gitRoot ( up )
118
119
}
119
120
120
121
static async create ( argv = process . argv , exitOverride = false ) {
Original file line number Diff line number Diff line change @@ -51,10 +51,9 @@ export class Config {
51
51
* @param cwd
52
52
*/
53
53
static findRoot ( pattern : string , cwd = process . cwd ( ) ) : string | undefined {
54
- if ( cwd == "/" ) return undefined
55
- const p = path . posix . resolve ( cwd , pattern )
54
+ const p = path . resolve ( cwd , pattern )
56
55
if ( fs . existsSync ( p ) ) return cwd
57
- const up = path . posix . resolve ( cwd , "../" )
56
+ const up = path . resolve ( cwd , "../" )
58
57
if ( up == cwd ) return undefined
59
58
return Config . findRoot ( pattern , up )
60
59
}
@@ -72,7 +71,7 @@ export class Config {
72
71
]
73
72
for ( const p of searchPaths ) {
74
73
if ( p ) {
75
- const file = path . posix . resolve ( p , "./devmoji.config.js" )
74
+ const file = path . resolve ( p , "./devmoji.config.js" )
76
75
if ( fs . existsSync ( file ) ) {
77
76
configFile = file
78
77
break
You can’t perform that action at this time.
0 commit comments