Skip to content

Commit 05b3fbb

Browse files
authored
fix: missing templates for docker setup command (#565)
1 parent 64f02bd commit 05b3fbb

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

packages/snap/scripts/move-templates.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ copy_templates() {
88
mkdir -p "$dest_dir"
99

1010
# Copy all non folder files while preserving the directory structure
11-
find "$src_dir" -type f | while read -r file; do
11+
find -L "$src_dir" -type f | while read -r file; do
1212
# Get the relative path of the file
1313
rel_path="${file#$src_dir/}"
1414
# Create the destination directory for the file
@@ -27,6 +27,7 @@ CREATE_TEMPLATES_SRC_DIR="$(dirname "$0")/../src/create/templates"
2727
CREATE_TEMPLATES_DEST_DIR="$(dirname "$0")/../dist/cjs/create/templates"
2828
copy_templates "$CREATE_TEMPLATES_SRC_DIR" "$CREATE_TEMPLATES_DEST_DIR"
2929

30+
3031
# Copy templates to ESM directory
3132
CREATE_TEMPLATES_DEST_DIR="$(dirname "$0")/../dist/esm/create/templates"
3233
copy_templates "$CREATE_TEMPLATES_SRC_DIR" "$CREATE_TEMPLATES_DEST_DIR"
@@ -40,3 +41,11 @@ copy_templates "$CREATE_STEP_TEMPLATES_SRC_DIR" "$CREATE_STEP_TEMPLATES_DEST_DIR
4041
# Copy step templates to ESM directory
4142
CREATE_STEP_TEMPLATES_DEST_DIR="$(dirname "$0")/../dist/esm/create-step/templates"
4243
copy_templates "$CREATE_STEP_TEMPLATES_SRC_DIR" "$CREATE_STEP_TEMPLATES_DEST_DIR"
44+
45+
# Copy docker templates
46+
DOCKER_TEMPLATES_SRC_DIR="$(dirname "$0")/../src/docker/templates"
47+
DOCKER_TEMPLATES_CJS_DEST_DIR="$(dirname "$0")/../dist/cjs/docker/templates"
48+
DOCKER_TEMPLATES_ESM_DEST_DIR="$(dirname "$0")/../dist/esm/docker/templates"
49+
50+
copy_templates "$DOCKER_TEMPLATES_SRC_DIR" "$DOCKER_TEMPLATES_CJS_DEST_DIR"
51+
copy_templates "$DOCKER_TEMPLATES_SRC_DIR" "$DOCKER_TEMPLATES_ESM_DEST_DIR"

packages/snap/src/create/interactive.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ interface CreateInteractiveArgs {
1818
skipConfirmation?: boolean
1919
}
2020

21-
export const createInteractive = async (
22-
{ skipConfirmation }: CreateInteractiveArgs,
23-
context: CliContext
24-
): Promise<void> => {
21+
export const createInteractive = async (_args: CreateInteractiveArgs, context: CliContext): Promise<void> => {
2522
context.log('welcome', (message) => message.append('\n🚀 ' + colors.bold('Welcome to Motia Project Creator!')))
2623

2724
const answers: InteractiveAnswers = await inquirer.prompt([

packages/snap/src/docker/setup.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ const createDockerfile = async () => {
4242
}
4343
}
4444

45-
const dockerfileContent = fs.readFileSync(
46-
path.join(__dirname, '../../../../docker', 'templates', 'MotiaDockerSample'),
47-
'utf-8',
48-
)
45+
const dockerfileContent = fs.readFileSync(path.join(__dirname, './templates', 'MotiaDockerSample'), 'utf-8')
4946

5047
try {
5148
fs.writeFileSync(dockerfilePath, dockerfileContent)
@@ -63,10 +60,7 @@ const createDockerignore = async () => {
6360
project_name: getProjectIdentifier(process.cwd()),
6461
})
6562

66-
const dockerignoreContent = fs.readFileSync(
67-
path.join(__dirname, '../../../../docker', 'templates', '.dockerignore.sample'),
68-
'utf-8',
69-
)
63+
const dockerignoreContent = fs.readFileSync(path.join(__dirname, './templates', '.dockerignore.sample'), 'utf-8')
7064

7165
const dockerignorePath = path.join(process.cwd(), '.dockerignore')
7266

packages/snap/src/docker/templates

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../docker/templates

0 commit comments

Comments
 (0)