-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
38 lines (32 loc) · 1.06 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Set the environment file to automatically load
set dotenv-load := true
set dotenv-filename := "ci_env"
set export := true
build_dir := "./build"
# Get version number from `version` file
VERSION := `cat version`
deb_file := build_dir + '/dir2prompt_' + VERSION + '.deb'
# Define a command variable for just with the current justfile specified
just := 'just --justfile "'+justfile()+'"'
# Default recipe: List all available commands
_default:
@{{just}} --list --unsorted
# Clean up the project
clean:
#!/usr/bin/env bash
if ! [[ -d "{{build_dir}}" ]]; then
exit 0
fi
printf "Cleaning up...\n"
rm -f "{{build_dir}}"/*
# Build and prepare configuration and executable scripts with substituted environment variables for deployment.
build: clean
#!/usr/bin/env bash
if ! [[ -d "{{build_dir}}" ]]; then
mkdir "{{build_dir}}"
fi
export RELEASE_DATE="$(date +%Y-%m-%d)"
envsubst '${MAINTAINER},${RELEASE_DATE},${VERSION}' \
< src/${PROGRAM_NAME}.sh \
> build/${PROGRAM_NAME}
chmod +x build/${PROGRAM_NAME}