@@ -5,6 +5,7 @@ import { describe, expect, it } from "@effect/vitest"
55import { Effect } from "effect"
66
77import type { TemplateConfig } from "../../src/core/domain.js"
8+ import { runCommandExitCode } from "../../src/shell/command-runner.js"
89import { prepareProjectFiles } from "../../src/usecases/actions/prepare-files.js"
910
1011const withTempDir = < A , E , R > (
@@ -113,8 +114,17 @@ describe("prepareProjectFiles", () => {
113114 )
114115
115116 const dockerfile = yield * _ ( fs . readFileString ( path . join ( outDir , "Dockerfile" ) ) )
116- const entrypoint = yield * _ ( fs . readFileString ( path . join ( outDir , "entrypoint.sh" ) ) )
117+ const entrypointPath = path . join ( outDir , "entrypoint.sh" )
118+ const entrypoint = yield * _ ( fs . readFileString ( entrypointPath ) )
117119 const composeBefore = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-compose.yml" ) ) )
120+ const entrypointSyntaxExitCode = yield * _ (
121+ runCommandExitCode ( {
122+ cwd : outDir ,
123+ command : "bash" ,
124+ args : [ "-n" , entrypointPath ]
125+ } )
126+ )
127+ expect ( entrypointSyntaxExitCode ) . toBe ( 0 )
118128 expect ( dockerfile ) . toContain ( "docker-compose-v2" )
119129 expect ( dockerfile ) . toContain ( "gitleaks version" )
120130 expect ( dockerfile ) . toContain (
@@ -130,6 +140,9 @@ describe("prepareProjectFiles", () => {
130140 expect ( entrypoint ) . toContain ( '"plugin": ["oh-my-opencode"]' )
131141 expect ( entrypoint ) . toContain ( "branch '$REPO_REF' missing; retrying without --branch" )
132142 expect ( entrypoint ) . not . toContain ( "git ls-remote --symref" )
143+ expect ( entrypoint ) . toContain ( "cat > \"$MOVE_SCRIPT\" << 'EOFMOVE'" )
144+ expect ( entrypoint ) . toMatch ( / \n E O F M O V E \n \s * c h m o d \+ x " \$ M O V E _ S C R I P T " / )
145+ expect ( entrypoint ) . not . toContain ( "\n EOFMOVE\n" )
133146 expect ( composeBefore ) . toContain ( "container_name: dg-test" )
134147 expect ( composeBefore ) . toContain ( "restart: unless-stopped" )
135148 expect ( composeBefore ) . toContain ( ":/home/dev/.docker-git" )
0 commit comments