From 5966d0ab90f821a586a152d83a964b1e10dc5920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 12 May 2023 19:16:29 +0200 Subject: [PATCH] data_dir --- conf/.eleventy.js | 6 +++--- manifest.toml | 3 +++ scripts/restore | 10 ++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/conf/.eleventy.js b/conf/.eleventy.js index 36b89e2..2ad0349 100644 --- a/conf/.eleventy.js +++ b/conf/.eleventy.js @@ -1,9 +1,9 @@ module.exports = function (eleventyConfig) { - eleventyConfig.addPassthroughCopy("./src/style.css"); + eleventyConfig.addPassthroughCopy("__DATA_DIR__/src/style.css"); return { dir: { - input: "src", - output: "public", + input: "__DATA_DIR__/src", + output: "__DATA_DIR__/public", }, }; }; diff --git a/manifest.toml b/manifest.toml index 7c06f9e..98dc64e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -46,6 +46,9 @@ ram.runtime = "50M" [resources.install_dir] + [resources.data_dir] + subdirs = ["src", "public"] + [resources.permissions] main.url = "/" diff --git a/scripts/restore b/scripts/restore index 8530d29..1950713 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,16 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +# (Same as for install dir) +chown -R $app:www-data "$data_dir" + #================================================= # RESTORE SYSTEM CONFIGURATIONS #=================================================