editors

view Euphoria.tmbundle/Commands/Test Current File.tmCommand @ 57:149815b0874c

* added installer for jEdit mode
author Shawn David Pringle B.Sc. <shawn.pringle@gmail.com>
date Fri Sep 25 00:03:32 2015 -0300 (2015-09-25)
parents 41e1f22adc1d
children
line source
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 <plist version="1.0">
4 <dict>
5 <key>name</key>
6 <string>Test Current File</string>
7 <key>uuid</key>
8 <string>DC2E2191-0318-4031-AC5C-7ED23D0F8732</string>
9 <key>input</key>
10 <string>none</string>
11 <key>output</key>
12 <string>showAsHTML</string>
13 <key>command</key>
14 <string># just to remind you of some useful environment variables
16 echo File: "$TM_FILEPATH"
17 echo Word: "$TM_CURRENT_WORD"
18 echo Selection: "$TM_SELECTED_TEXT"</string>
19 <key>runEnvironment</key>
20 <string>windows</string>
21 <key>winCommand</key>
22 <string>#!/usr/bin/env eui
24 include std/filesys.e
25 include std/io.e
26 include std/search.e
28 sequence FilePath = getenv("TM_FILEPATH")
29 sequence FileDir = getenv("TM_DIRECTORY")
30 sequence FileName = filename(FilePath)
31 filesys:chdir(FileDir)
32 filesys:delete_file("ex.err")
34 sequence command = sprintf("eui -wf ex.warn -test -batch %s", { FileName })
35 if system_exec(command) = 0 then
36 puts(1, `&lt;font color="#448844"&gt;&lt;b&gt;Success&lt;/b&gt;&lt;/font&gt;`)
37 else
38 puts(1, `&lt;font color="#ff0000"&gt;&lt;b&gt;Failure&lt;/b&gt;&lt;/font&gt;: `)
40 object exerr = io:read_lines("ex.err")
41 if sequence(exerr) and length(exerr) then
42 integer colon_pos = rfind(':', exerr[1])
43 if colon_pos != 0 then
44 sequence file_name = exerr[1][1 .. colon_pos - 1]
45 sequence line_no = exerr[1][colon_pos + 1 .. $]
47 file_name = find_replace('\\', file_name, '/')
49 sequence error_line = sprintf(`&lt;a href="txmt://open?url=file:///%s&amp;line=%s"&gt;%s, Line %s&lt;/a&gt;`, {
50 file_name, line_no,
51 file_name, line_no
52 })
53 printf(1, "%s\n", { error_line })
54 end if
55 puts(1, "&lt;pre&gt;\n")
56 for i = 1 to length(exerr) do
57 sequence line = exerr[i]
59 printf(1, "%s\n", { line })
60 end for
61 else
62 puts(1, "Unknown Failure")
63 end if
64 end if
65 </string>
66 <key>scope</key>
67 <string>source.euphoria</string>
68 <key>beforeRunningCommand</key>
69 <string>saveActiveFile</string>
70 <key>keyEquivalent</key>
71 <string>@N</string>
72 </dict>
73 </plist>

SCM Home | OpenEuphoria.org Home