Skip to content

Commit 32d1c23

Browse files
authored
fix(spawn): pass force flag to create command (#19)
* fix(cli): prevent dist-deps-prune from removing required effect peer dependencies * chore: version bump * fix(spawn): pass force flag to create command
1 parent d1ba017 commit 32d1c23

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

.changeset/fix-deps.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spawn-dock/cli": patch
3+
---
4+
5+
fix: retain effect peer dependencies in published package

packages/app/src/docker-git/cli/parser-spawn.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export const parseSpawn = (args: ReadonlyArray<string>): Either.Either<Command,
2323
const spawnCmd: SpawnCommand = {
2424
_tag: "Spawn",
2525
token: token.trim(),
26-
outDir: raw.outDir ?? ".spawn-dock/spawndock"
26+
outDir: raw.outDir ?? ".spawn-dock/spawndock",
27+
force: raw.force ?? false
2728
}
2829
return Either.right(spawnCmd)
2930
})

packages/app/src/docker-git/spawn.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const parseProjectDir = (output: string): string | null => {
9696
return match?.[1]?.trim() ?? null
9797
}
9898

99-
const buildSpawnCreateCommand = (outDir: string): CreateCommand => {
99+
const buildSpawnCreateCommand = (outDir: string, force: boolean): CreateCommand => {
100100
const repoSlug = deriveRepoSlug(SPAWNDOCK_REPO_URL)
101101
const containerName = `dg-${repoSlug}`
102102
const serviceName = `dg-${repoSlug}`
@@ -114,7 +114,7 @@ const buildSpawnCreateCommand = (outDir: string): CreateCommand => {
114114
},
115115
outDir,
116116
runUp: true,
117-
force: false,
117+
force,
118118
forceEnv: false,
119119
waitForClone: true,
120120
openSsh: false
@@ -134,7 +134,7 @@ export const spawnProject = (command: SpawnCommand) =>
134134
const path = yield* _(Path.Path)
135135

136136
yield* _(Effect.log("Creating SpawnDock container..."))
137-
const syntheticCreate = buildSpawnCreateCommand(command.outDir)
137+
const syntheticCreate = buildSpawnCreateCommand(command.outDir, command.force)
138138
yield* _(createProject(syntheticCreate))
139139

140140
const resolvedOutDir = path.resolve(command.outDir)

packages/lib/src/core/spawn-domain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export interface SpawnCommand {
77
readonly _tag: "Spawn"
88
readonly token: string
99
readonly outDir: string
10+
readonly force: boolean
1011
}

0 commit comments

Comments
 (0)