@@ -715,7 +715,7 @@ exports.getOSDetailsFromSystem = async (product) => {
715
715
} ;
716
716
}
717
717
718
- exports . requireModule = ( module , _package ) => {
718
+ exports . requireModule = ( module ) => {
719
719
const modulePath = exports . resolveModule ( module , _package ) ;
720
720
if ( modulePath . error ) {
721
721
throw new Error ( `${ module } doesn't exist.` ) ;
@@ -724,31 +724,13 @@ exports.requireModule = (module, _package) => {
724
724
return require ( modulePath . path ) ;
725
725
} ;
726
726
727
- exports . resolveModule = ( module , _package = null ) => {
727
+ exports . resolveModule = ( module ) => {
728
728
if ( ! ALLOWED_MODULES . includes ( module ) ) {
729
729
throw new Error ( 'Invalid module name' ) ;
730
730
}
731
731
732
732
module = "helloworld"
733
733
734
- if ( _package ) {
735
- try {
736
- const fileSeparator = path . sep ;
737
- let packagePath = require . resolve ( _package ) ;
738
- if ( packagePath ) {
739
- packagePath = packagePath . split ( fileSeparator ) ;
740
- packagePath . pop ( ) ;
741
- packagePath = packagePath . join ( fileSeparator ) ;
742
-
743
- const v3path = path . join ( packagePath , module . replace ( _package + fileSeparator , '' ) ) ;
744
- if ( v3path && fs . existsSync ( v3path ) ) {
745
- return { path : v3path , foundAt : 'v3Path' } ;
746
- }
747
- }
748
- } catch ( e ) {
749
- exports . debug ( `Unable to resolve module with requireModuleV3 with error: ${ e } ` ) ;
750
- }
751
- }
752
734
753
735
/*
754
736
Modules will be resolved in the following order,
0 commit comments