publishDev scripts create dirs, so we dont get annoying errors

This commit is contained in:
Michael Shanks 2020-02-22 22:24:19 +00:00
parent bd8c1a43a5
commit 91aa46836f
3 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
const { readdir, stat, copyFile } = require("fs-extra") const { readdir, stat, copyFile, ensureDir } = require("fs-extra")
const { constants } = require("fs") const { constants } = require("fs")
const { join, basename } = require("path") const { join, basename } = require("path")
const serverConfig = require("../../server/config")() const serverConfig = require("../../server/config")()
@ -26,6 +26,7 @@ const nodeModules = appName =>
const apps = await readdir(appPackages) const apps = await readdir(appPackages)
const copySource = file => async toDir => { const copySource = file => async toDir => {
await ensureDir(toDir)
const dest = join(toDir, basename(file)) const dest = join(toDir, basename(file))
try { try {
await copyFile(file, dest, constants.COPYFILE_FICLONE) await copyFile(file, dest, constants.COPYFILE_FICLONE)

View File

@ -1,4 +1,4 @@
const { readdir, stat, copyFile } = require("fs-extra") const { readdir, stat, copyFile, ensureDir } = require("fs-extra")
const { constants } = require("fs") const { constants } = require("fs")
const { join, basename } = require("path") const { join, basename } = require("path")
const serverConfig = require("../../server/config")() const serverConfig = require("../../server/config")()
@ -62,6 +62,7 @@ const nodeModules = appName =>
const apps = await readdir(appPackages) const apps = await readdir(appPackages)
const copySource = file => async toDir => { const copySource = file => async toDir => {
await ensureDir(toDir)
const dest = join(toDir, basename(file)) const dest = join(toDir, basename(file))
try { try {
await copyFile(file, dest, constants.COPYFILE_FICLONE) await copyFile(file, dest, constants.COPYFILE_FICLONE)

View File

@ -1,4 +1,4 @@
const { readdir, stat, copyFile } = require("fs-extra") const { readdir, stat, copyFile, ensureDir } = require("fs-extra")
const { constants } = require("fs") const { constants } = require("fs")
const { join, basename } = require("path") const { join, basename } = require("path")
const serverConfig = require("../../server/config")() const serverConfig = require("../../server/config")()
@ -56,6 +56,7 @@ const nodeModules = appName =>
const apps = await readdir(appPackages) const apps = await readdir(appPackages)
const copySource = file => async toDir => { const copySource = file => async toDir => {
await ensureDir(toDir)
const dest = join(toDir, basename(file)) const dest = join(toDir, basename(file))
try { try {
await copyFile(file, dest, constants.COPYFILE_FICLONE) await copyFile(file, dest, constants.COPYFILE_FICLONE)