File: faustremote

package info (click to toggle)
faust 2.79.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 397,496 kB
  • sloc: cpp: 278,433; ansic: 116,164; javascript: 18,529; vhdl: 14,052; sh: 13,884; java: 5,900; objc: 3,852; python: 3,222; makefile: 2,655; cs: 1,672; lisp: 1,146; ruby: 954; yacc: 586; xml: 471; lex: 247; awk: 110; tcl: 26
file content (46 lines) | stat: -rwxr-xr-x 1,201 bytes parent folder | download | duplicates (2)
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
39
40
41
42
43
44
45
46
#!/bin/bash

. usage.sh

#USAGE : faustremote <servurl> ==> <targets>
#USAGE : faustremote [<servurl>] <platform> <arch> <srcfile> ==> <binary.zip>

URL="34.76.156.75"

function targetrequest {
    curl  "$1/targets"
}

function compilation {
    curl -F"file=@\"$4\";filename=\"$4\""  "$1/compile/$2/$3/binary.zip" --output binary.zip
}


if [ "$1" == "-h" ]; then
    echo "Access the remote complation service to compile DSP programs"
    echo "Usage: faustremote [<servurl>] [<platform> <arch> <srcfile>]"
    echo "faustremote <servurl> ==> <targets>"
    echo "faustremote <servurl> <platform> <arch> <srcfile> ==> <binary.zip>"
    echo "When no <servurl> is defined, the default GRAME Faust URL service is used"
elif [ "$#" == "0" ]; then
    targetrequest "$URL"
elif [ "$#" == "1" ]; then
    targetrequest "$1"
elif [ "$#" == "3" ]; then
    if [ -f "$3" ]; then
        rm -rf binary.zip
        compilation $URL $1 $2 $3
    else 
        echo "ERROR: file $3 doesn't exist"
        exit 1
    fi
elif [ "$#" == "4" ]; then
    if [ -f "$4" ]; then
        rm -rf binary.zip
        compilation $1 $2 $3 $4
    else 
        echo "ERROR: file $4 doesn't exist"
        exit 1
    fi
fi