From 373c27618d598df7988ed8d70ac08ded7829d7c7 Mon Sep 17 00:00:00 2001 From: Bruno Amaral Date: Sun, 19 Jun 2022 12:39:07 +0100 Subject: [PATCH 1/2] get path of hugo command to run build --- build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 7550d37c..a75a1c56 100755 --- a/build.py +++ b/build.py @@ -11,6 +11,7 @@ import os import pandas as pd import pathlib +from shutil import which import sqlalchemy import subprocess import time @@ -279,7 +280,7 @@ ## BUILD THE WEBSITE #### ''') -args = ("/usr/local/bin/hugo", "-d", WEBSITE_PATH,"--cacheDir", GREGORY_DIR) +args = (which('hugo'), "-d", WEBSITE_PATH,"--cacheDir", GREGORY_DIR) popen = subprocess.Popen(args, stdout=subprocess.PIPE, universal_newlines=True) popen.wait() output = popen.stdout.read() From 16b695aab9f2c89538ba61e1fe66b779621d599d Mon Sep 17 00:00:00 2001 From: Bruno Amaral Date: Sun, 26 Jun 2022 19:35:49 +0100 Subject: [PATCH 2/2] avoid hardcoding hugo path --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 26931305..e1b0d879 100755 --- a/setup.py +++ b/setup.py @@ -7,6 +7,7 @@ import shutil import subprocess import sys +from shutil import which # TO DO: Run docker-compose up as root @@ -62,7 +63,7 @@ def is_git_repo(path): print("\N{check mark} Found django directory") else: print("Didn't find django, aborting ...") - break + print(''' #### ## Check for .env file @@ -126,7 +127,7 @@ def is_git_repo(path): #### ''') -args = ("/usr/local/bin/hugo", "mod", "get","-u") +args = (which('hugo'), "mod", "get","-u") popen = subprocess.Popen(args, stdout=subprocess.PIPE, universal_newlines=True) popen.wait() output = popen.stdout.read()