Skip to content

Commit

Permalink
env var doubling fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Sep 29, 2024
1 parent 9769851 commit 24c9304
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion mkn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: mkn
version: master
property:
DATE: 15-SEP-2024
DATE: 29-SEP-2024

parent: bin
mode: none
Expand Down
20 changes: 11 additions & 9 deletions src/maiken/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "maiken/github.hpp"
#include "maiken/regex.hpp"
#include "maiken/scm.hpp"
#include "maiken/regex.hpp"
#include "maiken/github.hpp"

namespace maiken {
void sub_initializer(Application const& app, std::vector<YAML::Node> const& nodes) {
Expand All @@ -40,13 +40,15 @@ void sub_initializer(Application const& app, std::vector<YAML::Node> const& node

auto const process = [&](auto n) {
if (n[STR_SUB] && n[STR_SUB].IsScalar()) {
for (auto const& line :
mkn::kul::cli::asArgs(Properties::RESOLVE(app, n[STR_SUB].Scalar()))) {
auto pInfo = ProjectInfo::PARSE_LINE(line);
mkn::kul::Dir local{pInfo.local};
if (!local)
SCMGetter::GET(local, pInfo.scm)
->co(local.path(), SCMGetter::REPO(local, pInfo.scm), pInfo.version);
auto const lines = mkn::kul::String::LINES(n[STR_SUB].Scalar());
for (auto const& input_line : lines) {
for (auto const& line : mkn::kul::cli::asArgs(Properties::RESOLVE(app, input_line))) {
auto pInfo = ProjectInfo::PARSE_LINE(line);
mkn::kul::Dir local{pInfo.local};
if (!local)
SCMGetter::GET(local, pInfo.scm)
->co(local.path(), SCMGetter::REPO(local, pInfo.scm), pInfo.version);
}
}
}
};
Expand Down
51 changes: 24 additions & 27 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,33 +149,32 @@ mkn::kul::yaml::Validator maiken::Settings::validator() const {
for (auto const& s : Compilers::INSTANCE().keys())
masks.push_back(NodeValidator(s, {}, 0, NodeType::STRING));

return Validator({
NodeValidator("super"), NodeValidator("property", {NodeValidator("*")}, 0, NodeType::MAP),
NodeValidator("inc"), NodeValidator("path"),
NodeValidator("local",
{NodeValidator("repo"), NodeValidator("mod-repo"), NodeValidator("debugger")},
0, NodeType::MAP),
NodeValidator("remote", {NodeValidator("repo"), NodeValidator("mod-repo")}, 0,
NodeType::MAP),
NodeValidator("env",
{NodeValidator("name", 1), NodeValidator("value", 1), NodeValidator("mode")},
0, NodeType::NON),
NodeValidator("file",
{NodeValidator("type", 1), NodeValidator("compiler", 1),
NodeValidator("linker"), NodeValidator("archiver")},
1, NodeType::LIST),
return Validator(
{NodeValidator("super"), NodeValidator("property", {NodeValidator("*")}, 0, NodeType::MAP),
NodeValidator("inc"), NodeValidator("path"),
NodeValidator("local",
{NodeValidator("repo"), NodeValidator("mod-repo"), NodeValidator("debugger")},
0, NodeType::MAP),
NodeValidator("remote", {NodeValidator("repo"), NodeValidator("mod-repo")}, 0,
NodeType::MAP),
NodeValidator("env",
{NodeValidator("name", 1), NodeValidator("value", 1), NodeValidator("mode")},
0, NodeType::NON),
NodeValidator("file",
{NodeValidator("type", 1), NodeValidator("compiler", 1),
NodeValidator("linker"), NodeValidator("archiver")},
1, NodeType::LIST),
#if defined(_MKN_WITH_MKN_RAM_) && defined(_MKN_WITH_IO_CEREAL_)
NodeValidator("dist",
{NodeValidator("port"),
NodeValidator("nodes",
{NodeValidator("host", 1), NodeValidator("port", 1),
NodeValidator("user"), NodeValidator("pass")},
0, NodeType::LIST)},
0, NodeType::MAP),
NodeValidator("dist",
{NodeValidator("port"),
NodeValidator("nodes",
{NodeValidator("host", 1), NodeValidator("port", 1),
NodeValidator("user"), NodeValidator("pass")},
0, NodeType::LIST)},
0, NodeType::MAP),
#endif // _MKN_WITH_MKN_RAM_ && _MKN_WITH_IO_CEREAL_
NodeValidator("compiler", {NodeValidator("mask", masks, 0, NodeType::MAP)}, 0,
NodeType::MAP)
});
NodeValidator("compiler", {NodeValidator("mask", masks, 0, NodeType::MAP)}, 0,
NodeType::MAP)});
}

void maiken::Settings::write(mkn::kul::File const& file) KTHROW(mkn::kul::Exit) {
Expand Down Expand Up @@ -310,13 +309,11 @@ void maiken::Settings::POST_CONSTRUCT() {
for (auto const& line : lines) {
auto copy = decltype(root[STR_ENV]){line};
auto ev = maiken::Settings::PARSE_ENV_NODE(copy, settings);
appVars.envVar(ev.name(), ev.toString());
mkn::kul::env::SET(ev.name(), ev.toString().c_str());
}
} else {
for (auto const& c : root[STR_ENV]) {
auto ev = maiken::Settings::PARSE_ENV_NODE(c, settings);
appVars.envVar(ev.name(), ev.toString());
mkn::kul::env::SET(ev.name(), ev.toString().c_str());
}
}
Expand Down

0 comments on commit 24c9304

Please sign in to comment.