Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: set content type of manifest files
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Apr 7, 2018
1 parent 047f613 commit cf7b4cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/commands/publish/s3.ts
Expand Up @@ -48,9 +48,9 @@ export default class Publish extends Command {
await uploadTarball(baseTarball)
for (const target of targets) {
await uploadTarball(target.tarball)
await S3.uploadFile(target.manifest, {...S3Options, Key: `${prefix}/${path.basename(target.manifest)}`, CacheControl: 'max-age=86400'})
await S3.uploadFile(target.manifest, {...S3Options, Key: `${prefix}/${path.basename(target.manifest)}`, CacheControl: 'max-age=86400', ContentType: 'application/json'})
}
action('uploading manifest')
await S3.uploadFile(versionPath, {...S3Options, Key: `${prefix}/version`, CacheControl: 'max-age=86400'})
await S3.uploadFile(versionPath, {...S3Options, Key: `${prefix}/version`, CacheControl: 'max-age=86400', ContentType: 'application/json'})
}
}
6 changes: 3 additions & 3 deletions src/tarballs/build.ts
Expand Up @@ -7,8 +7,8 @@ import {log} from './log'
import {fetchNodeBinary} from './node'

export interface IManifest {
channel: string
version: string
channel: string
sha256gz: string
sha256xz?: string
}
Expand Down Expand Up @@ -96,8 +96,8 @@ export async function build(root: string, channel = 'stable'): ReturnType<typeof
await pack(targetWorkspace, target.tarball('gz'), 'gz')
if (xz) await pack(targetWorkspace, target.tarball('xz'), 'xz')
const manifest: IManifest = {
channel,
version,
channel,
sha256gz: await qq.hash('sha256', target.tarball('gz')),
sha256xz: xz ? (await qq.hash('sha256', target.tarball('xz'))) : undefined,
}
Expand All @@ -107,8 +107,8 @@ export async function build(root: string, channel = 'stable'): ReturnType<typeof
await pack(baseWorkspace, t.baseTarball('gz'), 'gz')
if (xz) await pack(baseWorkspace, t.baseTarball('xz'), 'xz')
await qq.writeJSON(t.versionPath, {
channel,
version,
channel,
sha256gz: await qq.hash('sha256', t.baseTarball('gz')),
sha256xz: xz ? await qq.hash('sha256', t.baseTarball('xz')) : undefined,
rollout: typeof t.updateConfig.autoupdate === 'object' && t.updateConfig.autoupdate.rollout,
Expand Down

0 comments on commit cf7b4cc

Please sign in to comment.