From: Brendan Hansen Date: Wed, 29 Nov 2023 01:21:39 +0000 (-0600) Subject: added: check that git is installed in onyx package X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=refs%2Fheads%2Fdev;p=onyx.git added: check that git is installed in onyx package --- diff --git a/CHANGELOG b/CHANGELOG index d0b70f23..9eea6f2e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,11 @@ Additions: - Supported on WASIX and Onyx runtime - `os.getcwd` for getting the current directory - Supported on WASIX and Onyx runtime +- Basic build configurations into package manager. + - Configure sources files, runtime, target file, + included files, and CLI arguments + - Multiple configurations per project. + - Build with 'onyx package build ' Removals: diff --git a/scripts/onyx-pkg.onyx b/scripts/onyx-pkg.onyx index b497bef5..bfc85744 100644 --- a/scripts/onyx-pkg.onyx +++ b/scripts/onyx-pkg.onyx @@ -59,6 +59,13 @@ main :: (args: [] cstr) { return; } + if !Git.test_for_git() { + error_print("onyx package requires Git to be installed and accessible."); + info_print("", "Ensure Git is installed on your system.\n"); + os.exit(1); + return; + } + loaded_config_file := false; defer if loaded_config_file do store_config_file(); @@ -946,6 +953,14 @@ Package :: struct { } Git :: struct { + test_for_git :: () -> bool { + p := os.process_spawn(git_path, .[]); + return switch os.process_wait(&p) { + case .Success => true; + case #default => false; + }; + } + get_full_repo_uri :: (package_search: str) -> str { for Known_Repositories { for proto: Protocols {