mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1859: Ensure "dist" directory exists prior to enumerating NPM dependencies.
This commit is contained in:
@@ -91,6 +91,13 @@ class DependencyListPlugin {
|
||||
*/
|
||||
const logger = compiler.getInfrastructureLogger(PLUGIN_NAME);
|
||||
|
||||
/**
|
||||
* The directory receiving the dependency list file.
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
const outputPath = this.options.path || compiler.options.output.path;
|
||||
|
||||
/**
|
||||
* The full path to the output file that should contain the list of
|
||||
* discovered NPM module dependencies.
|
||||
@@ -98,7 +105,7 @@ class DependencyListPlugin {
|
||||
* @type {string}
|
||||
*/
|
||||
const outputFile = path.join(
|
||||
this.options.path || compiler.options.output.path,
|
||||
outputPath,
|
||||
this.options.filename || 'npm-dependencies.txt'
|
||||
);
|
||||
|
||||
@@ -132,6 +139,10 @@ class DependencyListPlugin {
|
||||
|
||||
});
|
||||
|
||||
// Create output path if it doesn't yet exist
|
||||
if (!fs.existsSync(outputPath))
|
||||
fs.mkdirSync(outputPath, { recursive: true, mode: 0o755 });
|
||||
|
||||
// Write all discovered NPM packages to configured output file
|
||||
const sortedCoords = Object.keys(moduleCoords).sort();
|
||||
fs.writeFileSync(outputFile, sortedCoords.join('\n') + '\n');
|
||||
|
Reference in New Issue
Block a user