diff --git a/.extfiles b/.extfiles index b2a8ac92..827c625b 100644 --- a/.extfiles +++ b/.extfiles @@ -4,4 +4,5 @@ icon.png redhat-icon.woff2 README.md dist/** -www/** \ No newline at end of file +www/** +!**/yarn.lock \ No newline at end of file diff --git a/Containerfile b/Containerfile index 9cf3151b..0b4c8c51 100644 --- a/Containerfile +++ b/Containerfile @@ -22,10 +22,4 @@ LABEL org.opencontainers.image.title="Red Hat Account" \ org.opencontainers.image.vendor="Red Hat" \ io.podman-desktop.api.version=">= 1.9.0" -COPY package.json /extension/ -COPY LICENSE /extension/ -COPY icon.png /extension/ -COPY redhat-icon.woff2 /extension/ -COPY README.md /extension/ -COPY dist /extension/dist -COPY www /extension/www +COPY builtin/redhat-authentication.cdix /extension diff --git a/scripts/build.js b/scripts/build.js index e9c8aa13..2d45d4ab 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -33,6 +33,7 @@ const extFiles = path.resolve(__dirname, '../.extfiles'); const fileStream = fs.createReadStream(extFiles, { encoding: 'utf8' }); const includedFiles = []; +const excludedFiles = []; // remove the .cdix file before zipping if (fs.existsSync(destFile)) { @@ -53,7 +54,7 @@ cproc.exec('yarn add object-hash@2.2.0 --cwd .', { cwd: './dist' }, (error, stdo byline(fileStream) .on('data', line => { - includedFiles.push(line); + line.startsWith('!') ? excludedFiles.push(line.substring(1)) : includedFiles.push(line); }) .on('error', () => { throw new Error('Error reading .extfiles'); @@ -62,7 +63,7 @@ cproc.exec('yarn add object-hash@2.2.0 --cwd .', { cwd: './dist' }, (error, stdo includedFiles.push(zipDirectory); // add destination dir mkdirp.sync(zipDirectory); console.log(`Copying files to ${zipDirectory}`); - cp(includedFiles, error => { + cp(includedFiles, { exclude: excludedFiles }, error => { if (error) { throw new Error('Error copying files', error); }