diff options
Diffstat (limited to 'scripts/build-unix.sh')
-rwxr-xr-x | scripts/build-unix.sh | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/scripts/build-unix.sh b/scripts/build-unix.sh index f485f9087..04aa9e70f 100755 --- a/scripts/build-unix.sh +++ b/scripts/build-unix.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | # INTRO: | 3 | # INTRO: |
4 | # This file is used to build ferdium on both x64 and arm-based for macos and linux (not tested on arm for linux). | 4 | # This file is used to build ferdium on both x64 and arm-based for macos and linux (not tested on arm for linux). |
5 | # It also handles any corrupted node modules with the 'CLEAN' env var (set it to 'true' for cleaning) | 5 | # It also handles any corrupted node modules with the 'CLEAN' env var (set it to 'true' for cleaning) |
6 | # It will install the system dependencies except for node and python (which are still verified) | 6 | # It will install the system dependencies except for node (which is still verified) |
7 | # I sometimes symlink my 'recipes' folder so that any changes that I need to do in it can also be committed and pushed independently | 7 | # I sometimes symlink my 'recipes' folder so that any changes that I need to do in it can also be committed and pushed independently |
8 | # This file can live anywhere in your PATH | 8 | # This file can live anywhere in your PATH |
9 | 9 | ||
@@ -32,7 +32,6 @@ command_exists() { | |||
32 | # Checking the developer environment | 32 | # Checking the developer environment |
33 | # Check for installed programmes | 33 | # Check for installed programmes |
34 | command_exists node || fail_with_docs "Node is not installed" | 34 | command_exists node || fail_with_docs "Node is not installed" |
35 | command_exists python || fail_with_docs "python is not installed" | ||
36 | 35 | ||
37 | # Check node version | 36 | # Check node version |
38 | EXPECTED_NODE_VERSION=$(cat .nvmrc) | 37 | EXPECTED_NODE_VERSION=$(cat .nvmrc) |
@@ -43,15 +42,6 @@ if [ "v$EXPECTED_NODE_VERSION" != "$ACTUAL_NODE_VERSION" ]; then | |||
43 | actual : [$ACTUAL_NODE_VERSION]" | 42 | actual : [$ACTUAL_NODE_VERSION]" |
44 | fi | 43 | fi |
45 | 44 | ||
46 | # Check python version | ||
47 | EXPECTED_PYTHON_VERSION=$(node -p 'require("./package.json").engines.python') | ||
48 | ACTUAL_PYTHON_VERSION=$(python --version | sed -e "s/Python //") | ||
49 | if [[ "$ACTUAL_PYTHON_VERSION" != "$EXPECTED_PYTHON_VERSION" ]]; then | ||
50 | fail_with_docs "You are not running the expected version of Python! | ||
51 | expected: [$EXPECTED_PYTHON_VERSION] | ||
52 | actual : [$ACTUAL_PYTHON_VERSION]" | ||
53 | fi | ||
54 | |||
55 | # Check if the 'recipes' folder is present either as a git submodule or a symbolic link | 45 | # Check if the 'recipes' folder is present either as a git submodule or a symbolic link |
56 | if ! [ -f "recipes/package.json" ]; then | 46 | if ! [ -f "recipes/package.json" ]; then |
57 | fail_with_docs "'recipes' folder is missing or submodule has not been checked out" | 47 | fail_with_docs "'recipes' folder is missing or submodule has not been checked out" |
@@ -78,7 +68,7 @@ else | |||
78 | fi | 68 | fi |
79 | 69 | ||
80 | npm cache clean --force | 70 | npm cache clean --force |
81 | rm -rf ~/.npm ~/.electron-gyp | 71 | rm -rf ~/.npm ~/.electron-gyp ~/.asdf/installs/nodejs/*/.npm/ |
82 | 72 | ||
83 | git -C recipes clean -fxd # Clean recipes folder/submodule | 73 | git -C recipes clean -fxd # Clean recipes folder/submodule |
84 | git clean -fxd # Note: This will blast away the 'recipes' folder if you have symlinked it | 74 | git clean -fxd # Note: This will blast away the 'recipes' folder if you have symlinked it |
@@ -89,6 +79,8 @@ fi | |||
89 | 79 | ||
90 | # ----------------------------------------------------------------------------- | 80 | # ----------------------------------------------------------------------------- |
91 | # Ensure that the system dependencies are at the correct version - recover if not | 81 | # Ensure that the system dependencies are at the correct version - recover if not |
82 | # If 'asdf' is installed, reshim for new nodejs if necessary | ||
83 | command_exists asdf && asdf reshim nodejs | ||
92 | 84 | ||
93 | # Ensure that the system dependencies are at the correct version | 85 | # Ensure that the system dependencies are at the correct version |
94 | # Check pnpm version | 86 | # Check pnpm version |
@@ -107,6 +99,9 @@ if [[ "$EXPECTED_PNPM_VERSION" != "$EXPECTED_RECIPES_PNPM_VERSION" ]]; then | |||
107 | actual : [$EXPECTED_PNPM_VERSION]" | 99 | actual : [$EXPECTED_PNPM_VERSION]" |
108 | fi | 100 | fi |
109 | 101 | ||
102 | # If 'asdf' is installed, reshim for new nodejs if necessary | ||
103 | command_exists asdf && asdf reshim nodejs | ||
104 | |||
110 | # ----------------------------------------------------------------------------- | 105 | # ----------------------------------------------------------------------------- |
111 | printf "\n*************** Building recipes ***************\n" | 106 | printf "\n*************** Building recipes ***************\n" |
112 | pushd recipes | 107 | pushd recipes |