Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: json output formatting #1051

Merged
merged 3 commits into from Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tarballs/build.ts
Expand Up @@ -59,7 +59,7 @@ export async function build(c: BuildConfig, options: {
pjson.oclif.update = pjson.oclif.update || {}
pjson.oclif.update.s3 = pjson.oclif.update.s3 || {}
pjson.oclif.update.s3.bucket = c.s3Config.bucket
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
}

const addDependencies = async () => {
Expand Down Expand Up @@ -156,7 +156,7 @@ export async function build(c: BuildConfig, options: {
sha: c.gitSha,
version: config.version,
}))
await fs.writeJSON(manifestFilepath, manifest)
await fs.writeJSON(manifestFilepath, manifest, {spaces: 2})
}

log(`gathering workspace for ${config.bin} to ${c.workspace()}`)
Expand Down
4 changes: 2 additions & 2 deletions test/integration/deb.test.ts
Expand Up @@ -26,13 +26,13 @@ describe('publish:deb', () => {
bucket = pjson.oclif.update.s3.bucket
basePrefix = pjson.oclif.update.s3.folder
await deleteFolder(bucket, `${basePrefix}/versions/${pjson.version}/`)
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
await fs.emptyDir(root)
})
afterEach(async () => {
await deleteFolder(bucket, `${basePrefix}/versions/${pjson.version}/`)
pjson.version = originalVersion
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
})

onlyLinux
Expand Down
4 changes: 2 additions & 2 deletions test/integration/macos.test.ts
Expand Up @@ -28,13 +28,13 @@ describe('publish:macos', () => {
bucket = pjson.oclif.update.s3.bucket
basePrefix = pjson.oclif.update.s3.folder
await deleteFolder(bucket, `${basePrefix}/versions/${pjson.version}/`)
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
await fs.emptyDir(root)
})
afterEach(async () => {
await deleteFolder(bucket, `${basePrefix}/versions/${pjson.version}/`)
pjson.version = originalVersion
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
})

onlyMacos
Expand Down
4 changes: 2 additions & 2 deletions test/integration/publish.test.ts
Expand Up @@ -72,13 +72,13 @@ const folderCleanup = async () => Promise.all([
describe('upload tarballs', async () => {
beforeEach(async () => {
await folderCleanup()
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
await fs.emptyDir(root)
})
afterEach(async () => {
await folderCleanup()
pjson.version = originalVersion
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
})

skipIfWindows
Expand Down
4 changes: 2 additions & 2 deletions test/integration/win.test.ts
Expand Up @@ -30,13 +30,13 @@ describe('publish:win', () => {
bucket = pjson.oclif.update.s3.bucket
basePrefix = pjson.oclif.update.s3.folder
await deleteFolder(bucket, `${basePrefix}/versions/${pjson.version}/`)
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
await fs.emptyDir(root)
})
afterEach(async () => {
await deleteFolder(bucket, `${basePrefix}/versions/${pjson.version}/`)
pjson.version = originalVersion
await fs.writeJSON(pjsonPath, pjson)
await fs.writeJSON(pjsonPath, pjson, {spaces: 2})
})

skipIfWindows
Expand Down