From 0263d9d5c84741121513d16d5cda721c45ee8838 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 11 Sep 2022 18:58:23 +0200 Subject: [PATCH] Specify homedir and yarnrc file for yarn commands --- scripts/install | 8 ++++++-- scripts/upgrade | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 91ffa96..4fedcd5 100644 --- a/scripts/install +++ b/scripts/install @@ -160,10 +160,14 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Building Yarn dependencies..." +touch "$final_path/.yarnrc.yml" +chmod 400 "$final_path/.yarnrc.yml" +chown $app:$app "$final_path/.yarnrc.yml" + pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --production --pure-lockfile - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cache clean + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH HOME="$final_path" yarn install --production --pure-lockfile + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH HOME="$final_path" yarn cache clean popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5f058f4..a26d7b3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -235,10 +235,14 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Building Yarn dependencies..." +touch "$final_path/.yarnrc.yml" +chmod 400 "$final_path/.yarnrc.yml" +chown $app:$app "$final_path/.yarnrc.yml" + pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --production --pure-lockfile - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cache clean + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH HOME="$final_path" yarn install --production --pure-lockfile + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH HOME="$final_path" yarn cache clean popd #=================================================