Skip to content

Commit

Permalink
🚑
Browse files Browse the repository at this point in the history
  • Loading branch information
waterbang committed Jul 4, 2023
1 parent 84dabd7 commit 1caadb9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plaoc/cli/helper/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,17 @@ export class BundleZipGenerator {
path: `usr/www`,
},
];
const addFile_DistToUsr = (filepath: string, alias: string = filepath) => {
const addFile_DistToUsr = async (
filepath: string,
alias: string = filepath
) => {
const path = import.meta.resolve(`../serve/${filepath}`);
let data = null;
// 如果是远程的
if (path.startsWith("http")) {
data = fs.readFileSync(import.meta.resolve(`../serve/${filepath}`));
data = await (await fetch(path)).text();
} else {
data = fs.readFileSync(
fileURLToPath(import.meta.resolve(`../serve/${filepath}`))
);
data = fs.readFileSync(fileURLToPath(path));
}
entries.push({
dir: false,
Expand Down

0 comments on commit 1caadb9

Please sign in to comment.