From e2d284797d0b2971e6f6d237b90dc3318d2e4c32 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 17 May 2020 21:50:50 -0700 Subject: [PATCH] set HOME explicity when calling migrate script --- setup/start.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/start.sh b/setup/start.sh index c1d5933be..23aef055b 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -176,9 +176,11 @@ readonly mysql_root_password="password" mysqladmin -u root -ppassword password password # reset default root password mysql -u root -p${mysql_root_password} -e 'CREATE DATABASE IF NOT EXISTS box' +# set HOME explicity, because it's not set when the installer calls it. this is done because +# paths.js uses this env var and some of the migrate code requires box code echo "==> Migrating data" cd "${BOX_SRC_DIR}" -if ! BOX_ENV=cloudron DATABASE_URL=mysql://root:${mysql_root_password}@127.0.0.1/box "${BOX_SRC_DIR}/node_modules/.bin/db-migrate" up; then +if ! HOME=${HOME_DIR} BOX_ENV=cloudron DATABASE_URL=mysql://root:${mysql_root_password}@127.0.0.1/box "${BOX_SRC_DIR}/node_modules/.bin/db-migrate" up; then echo "DB migration failed" exit 1 fi