mirror of https://github.com/exaloop/codon
Fallback to default plugin install path
parent
497a111f43
commit
70a8864e9f
|
@ -34,7 +34,7 @@ build/codon run test/core/exit.codon || if [[ $? -ne 42 ]]; then false; fi
|
||||||
|
|
||||||
# package
|
# package
|
||||||
export CODON_BUILD_ARCHIVE=codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz
|
export CODON_BUILD_ARCHIVE=codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz
|
||||||
mkdir -p codon-deploy/bin codon-deploy/lib/codon
|
mkdir -p codon-deploy/bin codon-deploy/lib/codon codon-deploy/plugins
|
||||||
cp build/codon codon-deploy/bin/
|
cp build/codon codon-deploy/bin/
|
||||||
cp build/libcodon*.so codon-deploy/lib/codon/
|
cp build/libcodon*.so codon-deploy/lib/codon/
|
||||||
cp build/libomp.so codon-deploy/lib/codon/
|
cp build/libomp.so codon-deploy/lib/codon/
|
||||||
|
|
|
@ -184,7 +184,7 @@ jobs:
|
||||||
|
|
||||||
- name: Prepare Artifacts
|
- name: Prepare Artifacts
|
||||||
run: |
|
run: |
|
||||||
mkdir -p codon-deploy/bin codon-deploy/lib/codon
|
mkdir -p codon-deploy/bin codon-deploy/lib/codon codon-deploy/plugins
|
||||||
cp build/codon codon-deploy/bin/
|
cp build/codon codon-deploy/bin/
|
||||||
cp build/libcodon*.${LIBEXT} codon-deploy/lib/codon/
|
cp build/libcodon*.${LIBEXT} codon-deploy/lib/codon/
|
||||||
cp build/libomp.${LIBEXT} codon-deploy/lib/codon/
|
cp build/libomp.${LIBEXT} codon-deploy/lib/codon/
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "plugins.h"
|
#include "plugins.h"
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|
||||||
#include "codon/parser/common.h"
|
#include "codon/parser/common.h"
|
||||||
|
@ -27,7 +28,14 @@ bool PluginManager::load(const std::string &path, std::string *errMsg) {
|
||||||
const std::string libExt = "so";
|
const std::string libExt = "so";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fs::path tomlPath = fs::path(path) / "plugin.toml";
|
const std::string config = "plugin.toml";
|
||||||
|
fs::path tomlPath = fs::path(path) / config;
|
||||||
|
if (!fs::exists(tomlPath)) {
|
||||||
|
// try default install path
|
||||||
|
if (auto *homeDir = std::getenv("HOME"))
|
||||||
|
tomlPath = fs::path(homeDir) / ".codon/plugins" / path / config;
|
||||||
|
}
|
||||||
|
|
||||||
toml::parse_result tml;
|
toml::parse_result tml;
|
||||||
try {
|
try {
|
||||||
tml = toml::parse_file(tomlPath.string());
|
tml = toml::parse_file(tomlPath.string());
|
||||||
|
|
Loading…
Reference in New Issue