Use path in docker/pack.js instead of path.posix (#6884)

This commit is contained in:
Nicola Krumschmidt
2021-07-19 22:15:24 +02:00
committed by GitHub
parent e10ef6a0f8
commit 0efe4fbba4

View File

@@ -5,7 +5,7 @@ const path = require('path');
const lernaListResult = execSync('npx lerna list --json'); //The "proper" way to do this with --include-dependencies and --scope won't work here because it includes devDependencies!
const list = JSON.parse(String(lernaListResult));
const apiPackageJson = require(path.posix.resolve(__dirname, '../api/package.json'));
const apiPackageJson = require(path.resolve(__dirname, '../api/package.json'));
const projectPackageJson = {
name: 'directus-project',
@@ -22,10 +22,10 @@ if (!existsSync('dist')) {
function addPackageRecursive(package) {
const tarName = String(
execSync(`npm pack ${package.location}`, { cwd: path.posix.resolve(__dirname, '..', 'dist') })
execSync(`npm pack ${package.location}`, { cwd: path.resolve(__dirname, '..', 'dist') })
).trim();
projectPackageJson.dependencies[package.name] = `file:${tarName}`;
const packageJson = require(path.posix.join(package.location, 'package.json'));
const packageJson = require(path.join(package.location, 'package.json'));
Object.keys(packageJson.dependencies || {}).forEach((dependencyName) => {
if (!projectPackageJson.dependencies[dependencyName]) {
const package = list.find((list) => list.name === dependencyName);
@@ -38,4 +38,4 @@ function addPackageRecursive(package) {
addPackageRecursive(directusPackage);
writeFileSync(path.posix.resolve(__dirname, '../dist/package.json'), JSON.stringify(projectPackageJson, null, 4));
writeFileSync(path.resolve(__dirname, '../dist/package.json'), JSON.stringify(projectPackageJson, null, 4));