File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ function parseRubyEngineAndVersion(rubyVersion) {
117117 rubyVersion = '.ruby-version'
118118 } else if ( fs . existsSync ( '.tool-versions' ) ) {
119119 rubyVersion = '.tool-versions'
120+ } else if ( fs . existsSync ( 'mise.toml' ) ) {
121+ rubyVersion = 'mise.toml'
120122 } else {
121123 throw new Error ( 'input ruby-version needs to be specified if no .ruby-version or .tool-versions file exists' )
122124 }
@@ -130,6 +132,11 @@ function parseRubyEngineAndVersion(rubyVersion) {
130132 const rubyLine = toolVersions . split ( / \r ? \n / ) . filter ( e => / ^ r u b y \s / . test ( e ) ) [ 0 ]
131133 rubyVersion = rubyLine . match ( / ^ r u b y \s + ( .+ ) $ / ) [ 1 ]
132134 console . log ( `Using ${ rubyVersion } as input from file .tool-versions` )
135+ } else if ( rubyVersion === 'mise.toml' ) { // Read from mise.toml
136+ const toolVersions = fs . readFileSync ( 'mise.toml' , 'utf8' ) . trim ( )
137+ const rubyLine = toolVersions . split ( / \r ? \n / ) . filter ( e => / ^ r u b y \s = \s / . test ( e ) ) [ 0 ]
138+ rubyVersion = rubyLine . match ( / ^ r u b y \s = \s " ( .+ ) " $ / ) [ 1 ]
139+ console . log ( `Using ${ rubyVersion } as input from file mise.toml` )
133140 }
134141
135142 let engine , version
You can’t perform that action at this time.
0 commit comments