@take-out/scripts 0.0.72 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/release.ts +5 -9
package/package.json
CHANGED
package/src/release.ts
CHANGED
|
@@ -342,12 +342,9 @@ async function syncOnZeroIn() {
|
|
|
342
342
|
|
|
343
343
|
async function syncOnZeroOut(version: string) {
|
|
344
344
|
if (!(await fs.pathExists(onZeroGithub))) return
|
|
345
|
-
console.info(' → on-zero: syncing out to github')
|
|
346
345
|
|
|
347
346
|
// copy src files from takeout to github
|
|
348
|
-
await fs.copy(join(onZeroTakeout, 'src'), join(onZeroGithub, 'src'), {
|
|
349
|
-
overwrite: true,
|
|
350
|
-
})
|
|
347
|
+
await fs.copy(join(onZeroTakeout, 'src'), join(onZeroGithub, 'src'), { overwrite: true })
|
|
351
348
|
await fs.copy(join(onZeroTakeout, 'cli.cjs'), join(onZeroGithub, 'cli.cjs'))
|
|
352
349
|
await fs.copy(join(onZeroTakeout, 'tsconfig.json'), join(onZeroGithub, 'tsconfig.json'))
|
|
353
350
|
|
|
@@ -356,10 +353,7 @@ async function syncOnZeroOut(version: string) {
|
|
|
356
353
|
const githubPkg = await fs.readJSON(join(onZeroGithub, 'package.json'))
|
|
357
354
|
const convertDeps = (deps: Record<string, string>) =>
|
|
358
355
|
Object.fromEntries(
|
|
359
|
-
Object.entries(deps || {}).map(([k, v]) => [
|
|
360
|
-
k,
|
|
361
|
-
v.startsWith('workspace:') ? `^${version}` : v,
|
|
362
|
-
])
|
|
356
|
+
Object.entries(deps || {}).map(([k, v]) => [k, v.startsWith('workspace:') ? `^${version}` : v])
|
|
363
357
|
)
|
|
364
358
|
await fs.writeJSON(
|
|
365
359
|
join(onZeroGithub, 'package.json'),
|
|
@@ -375,10 +369,12 @@ async function syncOnZeroOut(version: string) {
|
|
|
375
369
|
{ spaces: 2 }
|
|
376
370
|
)
|
|
377
371
|
|
|
378
|
-
// commit
|
|
372
|
+
// only commit if there are actual changes
|
|
379
373
|
const status = (await $`git -C ${onZeroGithub} status --porcelain`.text()).trim()
|
|
380
374
|
if (!status) return
|
|
381
375
|
|
|
376
|
+
console.info(' → on-zero: syncing out to github')
|
|
377
|
+
|
|
382
378
|
if (dryRun) {
|
|
383
379
|
console.info(` [dry-run] would push: sync: from takeout v${version}`)
|
|
384
380
|
await $`git -C ${onZeroGithub} checkout -- .`
|