-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·46 lines (39 loc) · 1.17 KB
/
install
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
#!/usr/bin/guile -s
!#
; Print header and general info.
(display "=======================")
(newline)
(display "Install script for pipe")
(newline)
(display "=======================")
(newline)
(display "This script will install pipe to Guile's site-dir folder.")
(newline)
(newline)
; Check if the install script was run as root.
(if (eq? (getuid) 0)
(begin
(display "Running as root, can proceed.")
(newline))
(begin
(display "Not running as root. Please rerun with sudo.")
(newline)
(quit)))
; Define the site dir to install in.
(define site-dir (%site-dir))
; Inform user of the dir being used.
(display (string-append "Using '" site-dir "' for installation folder."))
(newline)
; Create the site-dir if it does not exist.
(display (string-append "Creating '" site-dir "' if it does not exist... "))
(system (string-append "mkdir -p " site-dir))
(display "done.")
(newline)
; Copy to site dir.
(display (string-append "Copying './pipe' to '" site-dir "' install folder... "))
(system (string-append "cp ./pipe.scm " site-dir))
(display "done.")
(newline)
; Done message.
(display "Finished installation.")
(newline)