-
Notifications
You must be signed in to change notification settings - Fork 0
/
Compile Single File.tmCommand
74 lines (68 loc) · 2.02 KB
/
Compile Single File.tmCommand
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
#
# Compile a single file to a.out
#
# Get some HTML niceties
. "${TM_SUPPORT_PATH}/lib/html.sh"
. "${TM_SUPPORT_PATH}/lib/webpreview.sh"
# Prepare output window
html_header "`basename "${TM_FORTRAN:-gfortran}"` compile"
# TIP: from Allan Odgaard
# command1 &> >(command2)
# pipes the output of 'command1' to 'command2' but the status is still evaluated from 'command1'. Really cool.
# Pipe the output of the compiler to 'pre' which formats it nicely for HTML output
if cd "$TM_DIRECTORY" && "${TM_FORTRAN:-gfortran}" $TM_FFLAGS "`basename "$TM_FILEPATH"`" &> >(pre); then
echo "</pre>"
echo "<h2>Successfully compiled a.out</h2>"
else
echo "</pre>"
echo "<h2>Compilation failed</h2>"
fi
html_footer
</string>
<key>input</key>
<string>none</string>
<key>inputFormat</key>
<string>text</string>
<key>keyEquivalent</key>
<string>@b</string>
<key>name</key>
<string>Compile Single File</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>html</string>
<key>outputLocation</key>
<string>newWindow</string>
<key>requiredCommands</key>
<array>
<dict>
<key>command</key>
<string>gfortran</string>
<key>locations</key>
<array>
<string>/opt/local/bin/gfortran</string>
<string>/usr/local/bin/gfortran</string>
</array>
<key>variable</key>
<string>TM_FORTRAN</string>
</dict>
</array>
<key>scope</key>
<string>source.fortran</string>
<key>semanticClass</key>
<string>process.build.fortran</string>
<key>uuid</key>
<string>21AF6BCC-5AD2-4B47-8A6B-0EB7F27BD97C</string>
<key>version</key>
<integer>2</integer>
</dict>
</plist>