mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: housekeeping
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
const listDir = require('@sukka/listdir');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const fse = require('fs-extra');
|
||||
const fsp = require('fs/promises');
|
||||
const { copy } = require('fs-extra');
|
||||
const { task } = require('./lib/trace-runner');
|
||||
|
||||
const rootPath = path.resolve(__dirname, '../');
|
||||
@@ -17,8 +18,8 @@ const folderAndFilesToBeDeployed = [
|
||||
];
|
||||
|
||||
const buildPublicHtml = task(__filename, async () => {
|
||||
await fse.ensureDir(publicPath);
|
||||
await Promise.all(folderAndFilesToBeDeployed.map(dir => fse.copy(path.resolve(rootPath, dir), path.resolve(publicPath, dir))));
|
||||
await fsp.mkdir(publicPath, { recursive: true });
|
||||
await Promise.all(folderAndFilesToBeDeployed.map(dir => copy(path.resolve(rootPath, dir), path.resolve(publicPath, dir))));
|
||||
|
||||
const list = await listDir(publicPath, {
|
||||
ignoreHidden: true,
|
||||
|
||||
Reference in New Issue
Block a user