File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,16 @@ exports.handler = async (argv) => {
4747
4848 let container_arg = project_dir + ':' + container_dir ;
4949
50+ // Find out the image name.
51+ let image = argv . version ;
52+
53+ if ( valid_version_string ( argv . version ) )
54+ image = 'silex/emacs:' + argv . version + '-eask' ;
55+
5056 let default_cmd = [ 'docker' , 'run' , '--rm' ,
5157 '-v' , container_arg ,
5258 '-w' , container_dir ,
53- 'silex/emacs:' + argv . version + '-ci-eask' , ] ;
59+ image , ] ;
5460 let rest = process . argv . slice ( 4 ) ;
5561
5662 // If no argument; we enter the container directly!
@@ -76,3 +82,12 @@ exports.handler = async (argv) => {
7682function convert_path ( path ) {
7783 return UTIL . slash ( path ) . replaceAll ( ':' , '' ) ;
7884}
85+
86+ /**
87+ * Return true when string is a valid version string.
88+ * @param { String } str - The version string.
89+ */
90+ function valid_version_string ( str ) {
91+ const ver_regex = / ^ \d + ( \. \d + ) * ( - [ a - z A - Z 0 - 9 . ] + ) ? ( \+ [ a - z A - Z 0 - 9 . ] + ) ? $ / ;
92+ return ver_regex . test ( str ) ;
93+ }
You can’t perform that action at this time.
0 commit comments