Skip to content

Commit

Permalink
chore: fix saving of artifacts to build (#4583)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Jun 24, 2023
1 parent 941b4f2 commit a28768f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/qwik-save-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ async function prepare({ buildRepo, artifactsDir }: { buildRepo: string; artifac
await $('git', 'checkout', '-b', branch);
}

await $('cp', '-r', ...(await expand(artifactsDir)), buildRepoDir);
await $(
'cp',
'-r',
...(await expand(artifactsDir, ['.gitignore', 'node_modules'])),
buildRepoDir
);
await $('git', 'add', '--all');
await $(
'git',
Expand Down Expand Up @@ -112,11 +117,11 @@ async function $(cmd: string, ...args: string[]): Promise<string> {
return output;
}

async function expand(path: string): Promise<string[]> {
async function expand(path: string, ignore: string[] = []): Promise<string[]> {
const { stdout } = await execa('ls', ['-a', path]);
const paths = String(stdout)
.split('\n')
.filter((v) => v !== '.' && v !== '..' && v !== '.git')
.filter((v) => v !== '.' && v !== '..' && v !== '.git' && !ignore.includes(v))
.map((file) => path + '/' + file.trim());
return paths;
}

0 comments on commit a28768f

Please sign in to comment.