command-line-tool

How to deploy a Mac Command Line Tool

China☆狼群 提交于 2019-12-05 01:47:34
I've created a console application using the Xcode OS X Command Line Tool project template. When everything is said and done, where are the actual "Release" binaries placed on my machine? After searching SO, I found out where I could find the "Debug" binaries: ~/Library/Developer/Xcode/DerivedData/Project/Build/Products/Debug Where can I find the "Release" binaries? Or is there additional setup that is needed in Xcode to output these binaries so that I can distribute console application? The scheme settings determine whether the Debug or Release version is built. The default scheme builds

Terminate subprocesses of macOS command line tool in Swift

雨燕双飞 提交于 2019-12-04 20:37:40
I'm writing a macOS command line tool in swift which executes shell commands: let process = Process() process.launchPath = "/bin/sleep" process.arguments = ["100"] process.launch() process.waitUntilExit() However, if an interrupt ( CTRL-C ) or a terminate signal gets sent to my program, these shell commands don't get terminated and just continue with their execution. Is there a way to automatically terminate them if my program gets terminated unexpectedly? Here is what we did in order to react on interrupt ( CTRL-C ) when using two piped subprocesses. Idea behind : Blocking waitUntilExit()

Converting xlsx to xls using Microsoft Office Compitablity Pack's excelcnv

十年热恋 提交于 2019-12-04 17:17:45
The internet says that you can convert xlsx files to xls files using Microsoft Office Compitablity like this: "C:\Program Files\Microsoft Office\Office14\excelcnv" -nme -oice D:\test\new.xlsx D:\test\old.xls However, this works backwards - it converts xls files to xlsx files. Does anyone know the excelcnv switches to convert xlsx to xls? For me, using the compatibility (conversion) pack for Office 2003, simply switching the places of the parameters in the example you cite works; e.g. if this also works for ~\Office14 (which I assume and hope it does), change the command this way: "C:\Program

First line of batch file fails - is not recognized as an internal or external command, operable program or batch file

一个人想着一个人 提交于 2019-12-04 04:23:33
on Windows 7 in VS2012, I have setup an External Tool to call a bat file (let’s call it BatA.bat). In the external tool, I am passing in $(ItemDir) as the one and only Argument and I have the Initial Directory to $(ItemDir) as well. Within BatA.bat, a call is made to run BatB.bat like this: call "%1BatB.bat" This command calling BatB.bat results in the following in the output window: 'rem' is not recognized as an internal or external command, operable program or batch file. hello BatB.bat has the following code: rem ***Bat B*** @echo off echo. echo hello The odd thing is that in spite of

How can I match multi-line patterns in the command line with perl-style regex?

ⅰ亾dé卋堺 提交于 2019-12-04 04:10:40
问题 I regularly use regex to transform text. To transform, giant text files from the command line, perl lets me do this: perl -pe < in.txt > out.txt But this is inherently on a line-by-line basis. Occasionally, I want to match on multi-line things. How can I do this in the command-line? 回答1: To slurp a file instead of doing line by line processing, use the -0777 switch: perl -0777 -pe 's/.../.../g' in.txt > out.txt As documented in perlrun #Command Switches: The special value -00 will cause Perl

Node-sass is not recognized by command line

允我心安 提交于 2019-12-04 03:22:32
I'm trying to set up node-sass, following the instructions on CSS-Tricks . Node and npm are installed correctly, and the node-sass installation worked too. When I go to run node-sass --output-style compressed -o dist/css src/scss , though, I get an error message stating 'node-sass' is not recognized as an internal or external command, operable program or batch file. I've done a fair bit of Googling and searched Stack Overflow directly . My question isn't about "node" not being recognised as a command. I know node is working as I can run node -v and npm -v , and node-sass was successfully

Can't install Command Line Tool, “xcode-select --install” doesn't work

一曲冷凌霜 提交于 2019-12-03 15:41:51
问题 I don't know how to install the Command Line Tools on OSX Mavericks. Or better: I know how to do it (I just did it on another MacBook), but something goes wrong this time. What happened: I Install Homebrew on OSX Mavericks Homebrew ask me to intall the CLT and run a GUI for that I make a mistake: I install XCode instead of CLT, but I find that the CLT was not installed with it Now, when I write brew doctor I get this Warning: No developer tools installed. You should install the Command Line

macOS 10.14(beta) How to install Command_Line_Tools_macOS_10.14_for_Xcode_10_Beta

左心房为你撑大大i 提交于 2019-12-03 05:41:52
问题 As the Title of my question, I don't know how to install the Command_Line_Tools_macOS_10.14_for_Xcode_10_Beta for my mac, please help. What I did: run command "brew install carthage" to install the Carthage, get errors: Error: Your Xcode (9.4.1) is too outdated. Please update to Xcode 10.0 (or delete it). Xcode can be updated from https://developer.apple.com/download/more/ run command "xcode-select --install" in Terminal as the second answer from @Dev, but I still get the same errors after

Can't install Command Line Tool, “xcode-select --install” doesn't work

主宰稳场 提交于 2019-12-03 05:20:20
I don't know how to install the Command Line Tools on OSX Mavericks. Or better: I know how to do it (I just did it on another MacBook), but something goes wrong this time. What happened: I Install Homebrew on OSX Mavericks Homebrew ask me to intall the CLT and run a GUI for that I make a mistake: I install XCode instead of CLT, but I find that the CLT was not installed with it Now, when I write brew doctor I get this Warning: No developer tools installed. You should install the Command Line Tools. Run `xcode-select --install` to install them. I write what it says, but I get always Usage: xcode

Keep command line tool alive

僤鯓⒐⒋嵵緔 提交于 2019-12-03 02:33:40
How would a keep a command-line tool running for ever. This is my code: #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { @autoreleasepool { [[NSDistributedNotificationCenter defaultCenter] addObserverForName:nil object:nil queue:nil usingBlock:^(NSNotification *notification) { NSLog(@"%@", notification); }]; //Keep alive... } return 0; } You need to enter into a runloop using either CFRunLoop or NSRunLoop. Try: [[NSRunLoop currentRunLoop] run]; In Swift 4, RunLoop.current.run() Cheers. 来源: https://stackoverflow.com/questions/9449123/keep-command-line-tool-alive