Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
convert path obj to strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavybullets8 committed May 30, 2024
1 parent 59ecc7e commit a145891
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion heavy_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi
# generate the config.ini file if it does not exist
generate_config_ini

python3 utils/update_config.py "$script_path/config.ini"
python3 utils/update_config.py

# Separate bundled short options
args=()
Expand Down
16 changes: 5 additions & 11 deletions utils/update_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import sys
from pathlib import Path
from configobj import ConfigObj

def update_config(config_file_path):
config_file_path = Path(config_file_path)
default_config_path = Path(__file__).parent / '.default.config.ini'
def update_config():
config_file_path = str(Path(__file__).parent / 'config.ini')
default_config_path = str(Path(__file__).parent / '.default.config.ini')

# Load the existing config and default config
current_config = ConfigObj(config_file_path, encoding='utf-8', list_values=False)
Expand Down Expand Up @@ -32,10 +31,5 @@ def update_config(config_file_path):
# Write the updated config back to the file
current_config.write()

if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python update_config.py <config_file_path>")
sys.exit(1)

config_file_path = sys.argv[1]
update_config(config_file_path)
if __name__ == "__main__":
update_config()

0 comments on commit a145891

Please sign in to comment.