command-line-interface

CakePHP Bake Shell Error: Database connection “Mysql” is missing, or could not be created

一世执手 提交于 2019-12-05 03:32:09
I have an issue here with baking. I've read the previous answers to similar questions, but the solutions seem to not apply here. I can't bake because the error I receive is: Database connection “Mysql” is missing, or could not be created If I run which php the PHP it's reading is the correct path within MAMP. If I check the PDO modules: php -i | grep "PDO" PDO PDO support => enabled PDO drivers => sqlite, pgsql, mysql PDO Driver for MySQL => enabled PDO Driver for PostgreSQL => enabled PDO Driver for SQLite 3.x => enabled My application (or what I've completed on it so far) has no trouble

Use different filename for npm than “package.json”

点点圈 提交于 2019-12-05 03:31:34
Is there a way to tell npm from the command line to use a different file than "package.json"? Edit: Thank you for your answers. I already checked the docs and hoped there was a workaround or a non-documented way to achieve that. I'll think of something else then. Using only client-space tools, it seems pretty straightforward you can't. npm doc is positive about this : A package is: a) a folder containing a program described by a package.json file b) a gzipped tarball containing (a) c) a url thatresolves to (b) d) a <name>@<version> that is published on theregistry with (c) e) a <name>@<tag>

Automate Heroku CLI login

坚强是说给别人听的谎言 提交于 2019-12-05 02:57:51
I'm developing a bash script to automatic clone some projects and another task in dev VM's, but we have one project in Heroku and repository is in it. In my .sh file I have: > heroku login And this prompt to enter credentials, I read the "help" guide included on binary and documentation but I can't found anything to automatic insert username and password, I want something like this: > heroku login -u someUser -p mySecurePassword Exist any way similar to it? The Heroku CLI only uses your username and password to retrieve your API key , which it stores in your ~/.netrc file ( $HOME\_netrc on

Adding colors to terminal prompt results in large white space

霸气de小男生 提交于 2019-12-05 01:34:45
问题 I'm working on a simple cli script and wanted to add some color to the following code: rl.question('Enter destination path: ', function(answer) { // ... }); rl.write('/home/' + user + '/bin'); Which displays in the terminal: Enter destination path: /home/jmcateer/bin_ But I wanted to add some color to the prompt I did the following: rl.question('\u001b[1;36mEnter destination path:\u001b[0m ', function(answer) { }); rl.write('/home/' + user + '/bin'); And the command line prompt ended up

CLI “bq load” - how to use non-printable character as delimiter?

别来无恙 提交于 2019-12-04 22:28:11
I'm having trouble loading data into BigQuery as a single column row. I wish BigQuery offered the ability to have "no delimiter" as an option, but in the meantime I need to choose the most obscure ASCII delimiter I can find so my single column row is not split into columns. When doing this the CLI won't allow me to input strange characters, so I need to use the API through Python or other channels. How can I use the CLI instead with a non printable character? Python example from BigQuery lazy data loading: DDL, DML, partitions, and half a trillion Wikipedia pageviews : #!/bin/python from

Error creating android subproject when using phonegap run android command

南笙酒味 提交于 2019-12-04 21:20:34
问题 I installed nodejs and did the following: npm install -g phonegap phonegap create <app path> cd <app path> phonegap run android when i execute the run android command, I get below error: An error occurred during creation of android-sub project. The system cannot find the project specified. not sure where this is coming from. any clues. Thanks 回答1: Had the same problems and a hard time finding a solution, however: Make sure JAVA is installed Set JAVA_HOME & PATH variables Make sure ANT is

Cordova install on Linux

那年仲夏 提交于 2019-12-04 21:13:55
问题 Does anyone know how to install Cordova on Ubuntu/xUbuntu? My attempts at executing npm install cordova as directed from the link and other sources don't work. I get the following long error message: root@li141-82:/var/www/mysite# npm install cordova npm http GET https://registry.npmjs.org/cordova npm ERR! Error: failed to fetch from registry: cordova npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js

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()

How to enable PDO_MYSQL for CLI?

梦想的初衷 提交于 2019-12-04 20:13:48
I'm trying to learn the Symfony framework for PHP but having issues with the command line version of php. When trying to create the database tables: ./symfony doctrine:insert-sql I'm getting the following error: Couldn't locate driver named mysql This is only an issue with the command line version of php. I've had doctrine working no problem. After quickly reading up on the problem, it seems I need to enable PDO_MYSQL for the CLI installation of php. I've looked in the php.ini file and there does not appear to be a relevant entry for it. Is there any easy way to make the CLI version use

parsing argument in python

僤鯓⒐⒋嵵緔 提交于 2019-12-04 18:24:11
I have a problem I am trying to find a solution. I am not sure if I can do it with argparse. I want to be able to specify an option myprog -a 1 myprog -a 2 Now when I have a = 1 , I want to be able to specify b and c . But when a = 2 , I can only specify d . myprog -a 1 -b 3 -c 0 myprog -a 2 -d 3 Also a must always be specified You can't do this with switched values as a single parse_args call, but you can do one of: Use sub-commands/sub-parsers Do partial parsing before fully configuring the parser and running on the complete command line, at first only checking for a , and then selecting the