Skip to content

Commit

Permalink
chore: impove shellcheck and auto read version number (#155)
Browse files Browse the repository at this point in the history
* chore: improve shellcheck compatibility

Improve shellcheck compatibility of config/default

Signed-off-by: Stephan Wendel <me@stephanwe.de>

* chore: improve shellcheck compatibility

Improve shellcheck compatibility of config/raspberry/default

Signed-off-by: Stephan Wendel <me@stephanwe.de>

* chore: improve shellcheck compatibility

Improve shellcheck compatibilty of config/raspberry/rpi32

Signed-off-by: Stephan Wendel <me@stephanwe.de>

* chore: add version file

add version file to trigger Release Builds

Signed-off-by: Stephan Wendel <me@stephanwe.de>

* chore: change function name to get version number

Signed-off-by: Stefan Dej <meteyou@gmail.com>

Signed-off-by: Stephan Wendel <me@stephanwe.de>
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Co-authored-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
KwadFan and meteyou authored Sep 30, 2022
1 parent 40b3719 commit 9048152
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 9 deletions.
35 changes: 32 additions & 3 deletions config/default
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
export DIST_NAME=MainsailOS
export DIST_VERSION=0.7.1
export BASE_ZIP_IMG=`ls -t ${DIST_PATH}/image/*.{zip,7z,xz} | head -n 1`
#!/usr/bin/env bash
# Shebang for better file detection
# shellcheck enable=require-variable-braces

get_version() {
local ver
ver="$(realpath "$( dirname -- "${BASH_SOURCE[0]}")"/version)"
cat "${ver}"
}

get_img_name() {
local -a types
types=(zip 7z xz)
if [ -n "${DIST_PATH}" ]; then
for i in "${types[@]}"; do
find "${DIST_PATH}/image/" -type f -name "*.${i}" -printf "%p\n"
done
fi

if [ -z "${DIST_PATH}" ]; then
echo ""
fi
}

DIST_VERSION="$(get_version)"
BASE_ZIP_IMG="$(get_img_name)"
DIST_NAME="MainsailOS"

# export Variables
export DIST_NAME
export DIST_VERSION
export BASE_ZIP_IMG
17 changes: 13 additions & 4 deletions config/raspberry/default
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/usr/bin/env bash
# Shebang for better file detection

export BASE_IMAGE_ENLARGEROOT=2500
export BASE_IMAGE_RESIZEROOT=600
# Declare Variables before exporting.
# See https://www.shellcheck.net/wiki/SC2155

BASE_IMAGE_ENLARGEROOT=2500
BASE_IMAGE_RESIZEROOT=600
# Compress not needed due compression done in workflow
export BASE_RELEASE_COMPRESS=no
BASE_RELEASE_COMPRESS=no
# Modules are valid for 32bit and 64bit images
export MODULES="base,pkgupgrade,mainsailos(net,piconfig,klipper,is_req_preinstall,moonraker,timelapse,mainsail,crowsnest,sonar,password-for-sudo),postrename"
MODULES="base,pkgupgrade,mainsailos(net,piconfig,klipper,is_req_preinstall,moonraker,timelapse,mainsail,crowsnest,sonar,password-for-sudo),postrename"

# export Variables
export BASE_IMAGE_ENLARGEROOT
export BASE_IMAGE_RESIZEROOT
export BASE_RELEASE_COMPRESS
export MODULES
10 changes: 8 additions & 2 deletions config/raspberry/rpi32
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash
# Shebang for better file detection

export DOWNLOAD_URL_CHECKSUM="https://downloads.raspberrypi.org/raspios_lite_armhf_latest.sha256"
export DOWNLOAD_URL_IMAGE="https://downloads.raspberrypi.org/raspios_lite_armhf_latest.torrent"
# Declare Variables before exporting.
# See https://www.shellcheck.net/wiki/SC2155

DOWNLOAD_URL_CHECKSUM="https://downloads.raspberrypi.org/raspios_lite_armhf_latest.sha256"
DOWNLOAD_URL_IMAGE="https://downloads.raspberrypi.org/raspios_lite_armhf_latest.torrent"

export DOWNLOAD_URL_CHECKSUM
export DOWNLOAD_URL_IMAGE
1 change: 1 addition & 0 deletions src/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.7.1

0 comments on commit 9048152

Please sign in to comment.