Skip to content

Commit dedb333

Browse files
committed
Return to step-by-step menu and handle missing python
1 parent e85f96f commit dedb333

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

bootstrap/cli.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,24 @@
2424

2525

2626
def install_dependencies(minifi_options: MinifiOptions, package_manager: PackageManager) -> bool:
27-
return install_required(minifi_options, package_manager)
28-
27+
res = install_required(minifi_options, package_manager)
28+
print("Installation went smoothly" if res else "There were some error during installation")
29+
return False
2930

3031
def run_cmake(minifi_options: MinifiOptions, package_manager: PackageManager):
3132
if not os.path.exists(minifi_options.build_dir):
3233
os.mkdir(minifi_options.build_dir)
3334
cmake_cmd = f"cmake -G Ninja {minifi_options.create_cmake_options_str()} {minifi_options.source_dir} -B {minifi_options.build_dir}"
34-
return package_manager.run_cmd(cmake_cmd)
35+
res = package_manager.run_cmd(cmake_cmd)
36+
print("CMake command run successfully" if res else "CMake command run unsuccessfully")
37+
return False
3538

3639

3740
def do_build(minifi_options: MinifiOptions, package_manager: PackageManager):
3841
build_cmd = f"cmake --build {str(minifi_options.build_dir)}"
39-
return package_manager.run_cmd(build_cmd)
42+
res = package_manager.run_cmd(build_cmd)
43+
print("Build was successful" if res else "Build was unsuccessful")
44+
return res
4045

4146

4247
def do_one_click_build(minifi_options: MinifiOptions, package_manager: PackageManager) -> bool:

bootstrap/py_bootstrap.bat

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
@echo off
22

3+
REM Check if Python is installed
4+
where python > nul 2>&1
5+
if %errorlevel% neq 0 (
6+
echo Python is not installed
7+
exit /b 1
8+
)
9+
10+
REM Check if venv module is available
11+
python -m venv --help > nul 2>&1
12+
if %errorlevel% neq 0 (
13+
echo venv module is not available
14+
exit /b 1
15+
)
16+
317
set "SCRIPT_DIR=%~dp0"
418
set "VENV_DIR=%SCRIPT_DIR%venv"
519

bootstrap/py_bootstrap.sh

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#!/bin/bash
22

3+
# Check if Python is installed
4+
if ! command -v python3 &>/dev/null; then
5+
echo "Python is not installed"
6+
exit 1
7+
fi
8+
9+
# Check if virtualenv is installed
10+
if ! command -v virtualenv &>/dev/null; then
11+
echo "virtualenv is not installed"
12+
exit 1
13+
fi
14+
315
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
416
VENV_DIR="$SCRIPT_DIR/venv"
517

0 commit comments

Comments
 (0)