slides/build.sc
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 18 Oct 2024 05:45:14 +0100
changeset 969 0dfa2923a7c6
parent 943 5365ef60707e
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
928
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     1
#!/usr/bin/env amm
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     2
943
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
     3
val files = Seq("slides01.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
     4
	        "slides02.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
     5
	        "slides03.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
     6
	        "slides04.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
     7
	        "slides05.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
     8
                "slides06.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
     9
	        "slides07.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
    10
	        "slides08.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
    11
	        "slides09.tex",
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
    12
	        "slides10.tex")
928
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    13
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    14
val pdf_files = files.map(s => s.stripSuffix("tex") ++ "pdf")
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    15
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    16
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    17
@main
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    18
def make() = {
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    19
  for (f <- files) {
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    20
    println(s"Processing $f ...")
943
5365ef60707e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 937
diff changeset
    21
    os.proc("xelatex", f).call(stdout = os.Inherit, stdin = os.Inherit)
928
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    22
  }
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    23
}
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    24
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    25
@main
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    26
def hg() = {
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    27
  println(os.proc("hg", "commit", "-m texupdate", files ++ pdf_files).call())
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    28
  println(os.proc("hg", "push").call())
2f3c077359c4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    29
}