Skip to content

Commit 1b71e29

Browse files
authored
Merge pull request #2242 from Automattic/fix/abs-path
fix(dev-env): handling of absolute paths in configuration files
2 parents 0142221 + 04d6250 commit 1b71e29

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/lib/dev-environment/dev-environment-configuration-file.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,17 @@ function adjustRelativePaths(
135135
const configurationDirectory = path.resolve( path.dirname( configurationFilePath ) );
136136

137137
if ( configuration[ 'app-code' ] && configuration[ 'app-code' ] !== 'image' ) {
138-
configuration[ 'app-code' ] = path.join( configurationDirectory, configuration[ 'app-code' ] );
138+
const dir = configuration[ 'app-code' ];
139+
configuration[ 'app-code' ] = path.isAbsolute( dir )
140+
? dir
141+
: path.join( configurationDirectory, dir );
139142
}
140143

141144
if ( configuration[ 'mu-plugins' ] && configuration[ 'mu-plugins' ] !== 'image' ) {
142-
configuration[ 'mu-plugins' ] = path.join(
143-
configurationDirectory,
144-
configuration[ 'mu-plugins' ]
145-
);
145+
const dir = configuration[ 'mu-plugins' ];
146+
configuration[ 'mu-plugins' ] = path.isAbsolute( dir )
147+
? dir
148+
: path.join( configurationDirectory, dir );
146149
}
147150

148151
return configuration;

0 commit comments

Comments
 (0)