public static async prepareAspNetCoreBundleWindows()

in src/lib/beanstalkUtils.ts [25:60]


    public static async prepareAspNetCoreBundleWindows(
        dotnetPublishPath: string,
        tempDirectory: string
    ): Promise<string> {
        const zip = new AdmZip()

        const deploymentBundle = path.join(tempDirectory, 'ebDeploymentBundle.zip')

        console.log(tl.loc('CreatingBeanstalkBundle', deploymentBundle))
        console.log(tl.loc('PublishingPath', dotnetPublishPath))
        const stat = fs.statSync(dotnetPublishPath)
        try {
            if (stat.isFile()) {
                console.log(tl.loc('AddingAspNetCoreBundle', dotnetPublishPath))
                zip.addFile(path.basename(dotnetPublishPath), fs.readFileSync(dotnetPublishPath))
                const manifest = this.generateManifest('./' + path.basename(dotnetPublishPath), '/')
                console.log(tl.loc('AddingManifest'))
                zip.addFile('aws-windows-deployment-manifest.json', Buffer.from(manifest))
            } else {
                console.log(tl.loc('AddingFilesFromDotnetPublish'))
                zip.addLocalFolder(dotnetPublishPath, '/app/')
                const manifest = this.generateManifest('/app/', '/')
                console.log(tl.loc('AddingManifest'))
                zip.addFile('aws-windows-deployment-manifest.json', Buffer.from(manifest))
            }

            zip.writeZip(deploymentBundle)
        } catch (err) {
            console.log(tl.loc('ZipError', err))
            throw err
        }

        console.log(tl.loc('BundleComplete'))

        return deploymentBundle
    }