Skip to content

Commit 675e633

Browse files
author
Pablo Mendez
committed
copy notifications file in variants dir
1 parent aea2dc4 commit 675e633

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

src/tasks/buildAndUpload/getFileCopyTask.ts

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ async function copyFilesToReleaseDir({
5656
requireGitData?: boolean;
5757
}): Promise<void> {
5858
for (const variantProps of packagesToBuildProps) {
59-
60-
await copyVariantFilesToReleaseDir({ variantProps, rootDir, variantsDirPath, composeFileName });
59+
await copyVariantFilesToReleaseDir({
60+
variantProps,
61+
rootDir,
62+
variantsDirPath,
63+
composeFileName
64+
});
6165

6266
// Verify avatar (throws)
6367
const avatarPath = path.join(
@@ -82,14 +86,24 @@ async function copyVariantFilesToReleaseDir({
8286
variantsDirPath: string;
8387
composeFileName: string;
8488
}): Promise<void> {
85-
const { manifest, manifestFormat, releaseDir, compose, variant } = variantProps;
89+
const {
90+
manifest,
91+
manifestFormat,
92+
releaseDir,
93+
compose,
94+
variant
95+
} = variantProps;
8696

8797
// In case of single variant packages, the targets are in the root dir
88-
const variantDirPath = variant ? path.join(variantsDirPath, variant) : rootDir;
98+
const variantDirPath = variant
99+
? path.join(variantsDirPath, variant)
100+
: rootDir;
89101

90102
for (const [fileId, fileConfig] of Object.entries(releaseFiles)) {
91103
// For single variant packages, the targets are in the root dir
92-
const dirsToCopy = fs.existsSync(variantDirPath) ? [rootDir, variantDirPath] : [rootDir];
104+
const dirsToCopy = fs.existsSync(variantDirPath)
105+
? [rootDir, variantDirPath]
106+
: [rootDir];
93107

94108
switch (fileId as keyof typeof releaseFiles) {
95109
case "manifest":
@@ -111,6 +125,17 @@ async function copyVariantFilesToReleaseDir({
111125
}
112126
break;
113127

128+
case "notifications":
129+
// Copy the notifications in root and in the variant dir
130+
for (const dir of dirsToCopy) {
131+
copyReleaseFile({
132+
fileConfig: { ...fileConfig, id: fileId },
133+
fromDir: dir,
134+
toDir: releaseDir
135+
});
136+
}
137+
break;
138+
114139
default:
115140
copyReleaseFile({
116141
fileConfig: { ...fileConfig, id: fileId },

0 commit comments

Comments
 (0)