@@ -429,8 +429,9 @@ async function create_v_symlinks(prefix: string) {
429429 for await ( const { name, isDirectory, isSymlink } of Deno . readDir ( shelf ) ) {
430430 if ( isSymlink ) continue ;
431431 if ( ! isDirectory ) continue ;
432- if ( ! name . startsWith ( "v" ) ) continue ;
433432 if ( name == "var" ) continue ;
433+ if ( ! name . startsWith ( "v" ) ) continue ;
434+ if ( / ^ v \d + $ / . test ( name ) ) continue ; // pcre.org/v2
434435 const version = semver . parse ( name ) ;
435436 if ( version ) {
436437 versions . push ( version ) ;
@@ -494,7 +495,7 @@ function expand_runtime_env(
494495}
495496
496497function symlink_with_overwrite ( src : string , dst : string ) {
497- if ( existsSync ( dst ) ) {
498+ if ( existsSync ( dst ) && Deno . lstatSync ( dst ) . isSymlink ) {
498499 Deno . removeSync ( dst ) ;
499500 }
500501 Deno . symlinkSync ( src , dst ) ;
@@ -505,9 +506,9 @@ function get_pkgx() {
505506 const pkgx = join ( path , "pkgx" ) ;
506507 if ( existsSync ( pkgx ) ) {
507508 const out = new Deno . Command ( pkgx , { args : [ "--version" ] } ) . outputSync ( ) ;
508- const match = new TextDecoder ( ) . decode ( out . stdout ) . match ( / p k g x 2 . ( \d + ) / ) ;
509- if ( ! match || parseInt ( match [ 1 ] ) < 4 ) {
510- console . error ( "pkgm requires pkgx 2.4.0 or later" ) ;
509+ const stdout = new TextDecoder ( ) . decode ( out . stdout ) ;
510+ const match = stdout . match ( / ^ p k g x ( \d + . \d + ) / ) ;
511+ if ( ! match || parseFloat ( match [ 1 ] ) < 2.4 ) {
511512 Deno . exit ( 1 ) ;
512513 }
513514 return pkgx ;
0 commit comments