MCPcopy Create free account
hub / github.com/msgbyte/tailchat / deployToGithubPages

Function deployToGithubPages

client/desktop/scripts/deploy.ts:9–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7const deployDir = path.resolve(__dirname, '../release/deploy');
8
9async function deployToGithubPages() {
10 if (!(await fs.pathExists(outputDir))) {
11 throw new Error('outputDir does not exist');
12 }
13
14 await fs.ensureDir(deployDir);
15 await fs.emptyDir(deployDir);
16
17 console.log('Selecting file...');
18 const fileList = await fg(['*.zip', '*.exe'], {
19 cwd: outputDir,
20 });
21 console.log(fileList.map((f) => `- ${f}`).join('\n'));
22 await Promise.all(
23 fileList.map((f) =>
24 fs.copyFile(path.resolve(outputDir, f), path.resolve(deployDir, f))
25 )
26 );
27
28 console.log('Deploying to remote...');
29 // 部署到github pages
30 await new Promise<void>((resolve, reject) => {
31 ghpages.publish(
32 deployDir,
33 {
34 repo: 'git@github.com:msgbyte/tailchat-archive.git',
35 branch: 'gh-pages',
36 dest: './desktop/app',
37 push: true,
38 history: false,
39 },
40 (err) => {
41 if (err) {
42 reject(err);
43 } else {
44 resolve();
45 }
46 }
47 );
48 });
49
50 console.log('Completed!');
51}
52
53deployToGithubPages();

Callers 1

deploy.tsFile · 0.85

Calls 4

rejectFunction · 0.85
joinMethod · 0.80
logMethod · 0.65
allMethod · 0.45

Tested by

no test coverage detected