@@ -22,8 +22,7 @@ const defaultExtensionsDir = '/extensions';
2222const extensionsPattern = / ^ ( \S + ) - ( \d + \. \d + \. \d + | l a t e s t ) \. z i p $ / ; // e.g. extension-name-0.0.1.zip
2323const versionPattern = / ^ \d + [ . ] \d + [ . ] \d + $ / ; // e.g. 0.0.1
2424const SUFFIX_OLD = '__old' ;
25- const odoExtensionName = "codewind-odo-extension" ;
26- const odoDevfileExtensionName = "codewind-odo-extension-devfile" ;
25+ const odoExtensionNamePrefix = "codewind-odo" ;
2726
2827/**
2928 * Install (unzip) built-in extensions that are stored in /extensions to the
@@ -59,13 +58,13 @@ async function installBuiltInExtension(file, targetDir, extensionsDir) {
5958 const version = match [ 2 ] ;
6059 log . trace ( `extensionPattern - name: ${ name } , version ${ version } ` ) ;
6160
62- if ( ( [ odoExtensionName , odoDevfileExtensionName ] . includes ( name ) ) && ( process . env . ON_OPENSHIFT != 'true' ) ) {
61+ if ( name . startsWith ( odoExtensionNamePrefix ) && ( process . env . ON_OPENSHIFT != 'true' ) ) {
6362 return ;
6463 }
6564
6665 const source = path . join ( extensionsDir , file . name ) ;
6766 const target = path . join ( targetDir , name ) ;
68- const directoryToUnzipTo = `temp_ ${ target } ` ;
67+ const directoryToUnzipTo = `${ target } _temp ` ;
6968
7069 try {
7170 if ( await prepForUnzip ( target , version ) ) {
@@ -76,7 +75,8 @@ async function installBuiltInExtension(file, targetDir, extensionsDir) {
7675
7776 // Move unzipped files up a directory and to their final name
7877 const [ parentDirFromZip ] = await fs . readdir ( directoryToUnzipTo ) ;
79- await fs . rename ( path . join ( directoryToUnzipTo , parentDirFromZip ) , target ) ;
78+ const tempDir = path . join ( directoryToUnzipTo , parentDirFromZip ) ;
79+ await fs . rename ( tempDir , target ) ;
8080 }
8181 }
8282 catch ( err ) {
0 commit comments