Small Debug Fixes
This commit is contained in:
parent
742ead51e1
commit
5d8a1e4230
@ -1,10 +1,6 @@
|
||||
# Manual Installation
|
||||
[Download Packages Here](https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/master/lastSuccessfulBuild/artifact/out/)
|
||||
|
||||
## Supported Distributions
|
||||
* Ubuntu 20.04+
|
||||
* Debian Bullseye+
|
||||
|
||||
## Picking A Package
|
||||
|
||||
### Name Format
|
||||
|
@ -31,9 +31,12 @@ static void trim(char **value) {
|
||||
*value = &(*value)[1];
|
||||
}
|
||||
}
|
||||
static void set_and_print_env(const char *name, char *value) {
|
||||
void set_and_print_env(const char *name, char *value) {
|
||||
// Set Variable With No Trailing Colon
|
||||
static const char *unmodified_name_prefix = "MCPI_";
|
||||
if (strncmp(unmodified_name_prefix, name, strlen(unmodified_name_prefix)) != 0) {
|
||||
trim(&value);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// Print New Value
|
||||
|
@ -4,6 +4,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void set_and_print_env(const char *name, char *value);
|
||||
|
||||
void bootstrap(int argc, char *argv[]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -92,7 +92,7 @@ static void run_command_and_set_env(const char *env_name, char *command[]) {
|
||||
output[length - 1] = '\0';
|
||||
}
|
||||
// Set
|
||||
setenv(env_name, output, 1);
|
||||
set_and_print_env(env_name, output);
|
||||
}
|
||||
// Check Return Code
|
||||
if (return_code != 0) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
int main(int argc, char *argv[]) {
|
||||
// Set Home To Current Directory, So World Data Is Stored There
|
||||
char *launch_directory = getcwd(NULL, 0);
|
||||
setenv("HOME", launch_directory, 1);
|
||||
set_and_print_env("HOME", launch_directory);
|
||||
free(launch_directory);
|
||||
|
||||
// Bootstrap
|
||||
|
Loading…
Reference in New Issue
Block a user