Skip to content

Commit d9f8a4f

Browse files
committed
fix(dogfood): fix startup script on worksapce creation
1 parent 215a9d1 commit d9f8a4f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dogfood/main.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,15 @@ resource "coder_agent" "dev" {
266266
sudo service docker start
267267
# Install playwright dependencies
268268
# We want to use the playwright version from site/package.json
269-
cd "${local.repo_dir}/site" && pnpm install && pnpm playwright:install
270-
EOT
269+
# Check if the directory exists At workspace creation as the coder_script runs in parallel so clone does not exist.
270+
# it will run on fine on a restart though
271+
if [ -d "${local.repo_dir}/site" ]; then
272+
cd "${local.repo_dir}/site" && pnpm install && pnpm playwright:install
273+
else
274+
echo "The directory ${local.repo_dir}/site does not exist. Clone is not complete."
275+
echo 'Please run "${local.repo_dir}/site && pnpm install && pnpm playwright:instal" after workspace creation'
276+
fi
277+
EOT
271278
}
272279

273280
resource "docker_volume" "home_volume" {

0 commit comments

Comments
 (0)