Sublime REPL bug while runing Swift in Linux -
i have set sublime repl work swift, facing problems. note below code runs without errors in terminal.
the following code:
import foundation func execcommand(command: string, args: [string]) -> string { if !command.hasprefix("/") { let commandfull = execcommand(command: "/usr/bin/which", args: [command]).trimmingcharacters(in: characterset.whitespacesandnewlines) return execcommand(command: commandfull, args: args) } else { let proc = process() proc.launchpath = command proc.arguments = args let pipe = pipe() proc.standardoutput = pipe proc.launch() let data = pipe.filehandleforreading.readdatatoendoffile() return string(data: data, encoding: string.encoding.utf8)! } } let commandoutput = execcommand(command:"file-roller", args:["hello, here!"]) print("command output: \(commandoutput)")
causes errors in repl, in turn complains foundation building.
/usr/lib/swift/corefoundation/corefoundation.h:25:10: note: while building module 'swiftglibc' imported /usr/lib/swift/corefoundation/corefoundation.h:25: #include <sys/types.h> ^
my swift repl configuration is:
[ { "id": "tools", "children": [{ "caption": "sublimerepl", "mnemonic": "r", "id": "sublimerepl", "children": [ {"command": "repl_open", "caption": "swift", "id": "repl_swift", "args": { "type": "subprocess", "external_id": "swift", "encoding": "utf8", "cmd": { "osx": ["/applications/xcode6-beta.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/swift"], "linux":["swift"]}, "cwd": "$file_path", "additional_scopes": ["swift"], "syntax": "packages/swift/syntaxes/swift.tmlanguage" } } ] }] } ]
i can't figure out happening there, seems configuration ok. suggestion of action?
Comments
Post a Comment