aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/meta
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-11-27 20:35:14 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit6dc69228f20b3566320b52966b3782d633171e71 (patch)
tree893201ffbd3bbd6c1ccb595be2af8354593cb49a /src/sdp/meta
parent0.20.1 struct for opt_actions (diff)
0.20.2 paths, config & manifest files
Diffstat (limited to 'src/sdp/meta')
-rw-r--r--src/sdp/meta/read_config_files.d27
-rw-r--r--src/sdp/meta/read_source_files.d1
-rw-r--r--src/sdp/meta/rgx.d10
3 files changed, 10 insertions, 28 deletions
diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d
index 012ccb6..369d9c2 100644
--- a/src/sdp/meta/read_config_files.d
+++ b/src/sdp/meta/read_config_files.d
@@ -7,32 +7,11 @@ module sdp.meta.read_config_files;
static template configIn() {
import
sdp.meta,
+ sdp.output.paths_source,
std.file,
std.path;
final string configIn(C,E)(C conf_sdl, E env) {
- /+ FIX clean up conf paths ↓ +/
- string sisudoc_conf_pwd = chainPath(to!string(env["pwd"]), "sisudoc/conf").array;
- string sisudoc_conf_pwd_a = chainPath(to!string(env["pwd"]), "conf").array;
- string sisudoc_conf_pwd_b = chainPath(to!string(env["pwd"]), "../conf").array;
- string sisudoc_conf_pwd_c = chainPath(to!string(env["pwd"]), "../../conf").array;
- string sisudoc_conf_pwd_d = chainPath(to!string(env["pwd"]), "../../../conf").array;
- /+ FIX clean up conf paths ↑
- (compare pwd to doc path location, and build config path)
- +/
- string dot_pwd = chainPath(to!string(env["pwd"]), ".sisu").array;
- string underscore_pwd = chainPath(to!string(env["pwd"]), "_sisu").array;
- string dot_home = chainPath(to!string(env["home"]), ".sisu").array;
- string[] possible_config_path_locations = [
- sisudoc_conf_pwd,
- sisudoc_conf_pwd_a,
- sisudoc_conf_pwd_b,
- sisudoc_conf_pwd_c,
- sisudoc_conf_pwd_d,
- dot_pwd,
- underscore_pwd,
- dot_home,
- "/etc/sisu"
- ];
+ auto possible_config_path_locations = ConfigFilePaths!()(env).possible_config_path_locations;
string config_file_str;
foreach(pth; possible_config_path_locations) {
auto conf_file = format(
@@ -67,6 +46,7 @@ static template ConfigSDLang() {
import sdlang;
import
sdp.meta,
+ sdp.output.paths_source,
std.file,
std.path;
auto ConfigSDLang(string configuration, string conf_sdl_filename) {
@@ -86,6 +66,7 @@ static template ConfigSDLang() {
static template configRead() {
import
sdp.meta,
+ sdp.output.paths_source,
std.file,
std.path;
diff --git a/src/sdp/meta/read_source_files.d b/src/sdp/meta/read_source_files.d
index 0443ded..ccda78c 100644
--- a/src/sdp/meta/read_source_files.d
+++ b/src/sdp/meta/read_source_files.d
@@ -9,6 +9,7 @@ static template SiSUrawMarkupContent() {
sdp.meta.rgx;
import
sdp.meta,
+ sdp.output.paths_source,
std.file,
std.path;
mixin SiSUrgxInit;
diff --git a/src/sdp/meta/rgx.d b/src/sdp/meta/rgx.d
index bf1b175..70f48bb 100644
--- a/src/sdp/meta/rgx.d
+++ b/src/sdp/meta/rgx.d
@@ -196,13 +196,13 @@ static template SiSUrgxInit() {
static nbsp_chars_line_start = ctRegex!(`^░+`, "mg");
static nbsp_and_space = ctRegex!(`&nbsp;[ ]`, "mg");
static nbsp_char_and_space = ctRegex!(`░[ ]`, "mg");
- static src_pth = ctRegex!(`^(?P<path>(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])$`);
- static src_pth_contents = ctRegex!(`^(?P<path>(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+)/sisudoc[.]txt$`);
- static src_pth_zip = ctRegex!(`^(?P<path>(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.]zip)$`);
+ static src_pth = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])$`);
+ static src_pth_contents = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+)/sisudoc[.]txt$`);
+ static src_pth_zip = ctRegex!(`^(?P<path>[/]?(?:[a-zA-Z0-9._-]+/)*)(?P<filename>[a-zA-Z0-9._-]+[.]zip)$`);
static src_pth_unzip_pod = ctRegex!(`^(?P<path>media/text/[a-z]{2}/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`);
- static src_pth_types = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<gotfile>(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])|(?P<filelist>[a-zA-Z0-9._-]+/sisudoc[.]txt)|(?P<filezip>[a-zA-Z0-9._-]+[.]zip))$`);
+ static src_pth_types = ctRegex!(`^(?P<path>[/]?[a-zA-Z0-9._-]+/)*(?P<gotfile>(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])|(?P<filelist>[a-zA-Z0-9._-]+/sisudoc[.]txt)|(?P<filezip>[a-zA-Z0-9._-]+[.]zip))$`);
static src_fn =
- ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P<fn_src>(?P<fn_base>[a-zA-Z0-9._-]+)[.](?P<fn_src_suffix>ss[tm]))$`);
+ ctRegex!(`^([/]?(?:[a-zA-Z0-9._-]+/)*)(?P<fn_src>(?P<fn_base>[a-zA-Z0-9._-]+)[.](?P<fn_src_suffix>ss[tm]))$`);
static src_fn_master = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssm)$`);
static src_fn_text = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]sst)$`);
static src_fn_insert = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssi)$`);