summaryrefslogtreecommitdiff
path: root/backend/modules/frontend
blob: 0463863bf07b7f4d9ddcd14efdccb7e413644f0a (plain)
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
#!/bin/bash

function send()
{
	command="$1"
	shift
	echo "<acritoxinstaller $command> $@"
}

function send_error()
{
	if [ "$#" -gt 1 ]; then
		send error "$@"
	elif [ "$#" -eq 1 ]; then
		send error "$1" "$(tr -d '\n')"
	else
		send error 255 unknown
	fi
	return 1
}

function emit_progress()
{
        percent=$1
        [ "$percent" -gt 100 ] && percent=100
        send progress "$percent"
}