Comments (9)
See if this helps you out :
var cmd=require('node-cmd');
var readline = require('readline');
var repository;
var rl = readline.createInterface(
{
input: process.stdin,
output: process.stdout
}
);
rl.question(
"Enter adress: ",
function(address) {
repository = address.slice(address.lastIndexOf('/')+1, address.length);
console.log(repository);
var commands=`git clone ${address}
cd ${repository}
git log
dir`;
console.log(commands); //see if this is what you expect
cmd.get(
commands,
function(data){
console.log('the output is :\n\n',data)
}
);
}
);
from node-cmd.
My guess is that it should work just as I wrote it it there if you copy and paste it unless your code has an issue somewhere.
from node-cmd.
thank you, if there is any instroction to use it?
2016-01-10 16:05 GMT+02:00 Brandon Nozaki Miller [email protected]:
My guess is that it should work just as I wrote it it there if you copy
and paste it unless your code has an issue somewhere.—
Reply to this email directly or view it on GitHub
#2 (comment)
.
from node-cmd.
To use what? node-cmd? It allows you to execute command line code. If you want to execute more than one line at a time you will have to put them all into one command.
Is that what you are asking?
from node-cmd.
I just asking about what you adviced me before with that "$".
2016-01-10 22:47 GMT+02:00 Brandon Nozaki Miller [email protected]:
To use what? node-cmd? It allows you to execute command line code. If you
want to execute more than one line at a time you will have to put them all
into one command.Is that what you are asking?
—
Reply to this email directly or view it on GitHub
#2 (comment)
.
from node-cmd.
I mean what the difference beetwen standart writing the code and that one?
How does it work?
2016-01-10 16:19 GMT+02:00 Александр Бондаренко [email protected]:
thank you, if there is any instroction to use it?
2016-01-10 16:05 GMT+02:00 Brandon Nozaki Miller <[email protected]
:
My guess is that it should work just as I wrote it it there if you copy
and paste it unless your code has an issue somewhere.—
Reply to this email directly or view it on GitHub
#2 (comment)
.
from node-cmd.
Its called a template string and it is a part of ES6. It is built into JavaScript now. And it is AWESOME!
notice I did not use quotes. I used a back tic -> ` <- not a ' or a "
//using a back tics
let a = 123;
let b = `a is : ${a}`;
console.log(a);
your console will log a is : 123
//using regular quotes
let a = 123;
let b = 'a is : ${a}';
console.log(a);
your console will log a is : ${a}
Check out the documentation on MDN : Template strings - JavaScript | MDN
from node-cmd.
Thanks, because i haven't learned ES6 yet)
2016-01-11 11:59 GMT+02:00 Brandon Nozaki Miller [email protected]:
Its called a template string and it is a part of ES6. It is built into
JavaScript now. And it is AWESOME!notice I did not use quotes. I used a back tic -> ` <- not a ' or a "
//using a back ticslet a = 123;let b =
a is : ${a}
;console.log(a);your console will log a is : 123
//using regular quoteslet a = 123;let b = 'a is : ${a}';console.log(a);
your console will log a is : ${a}
Check out the documentation on MDN : Template strings - JavaScript | MDN
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings—
Reply to this email directly or view it on GitHub
#2 (comment)
.
from node-cmd.
a lot is supported now in node v4.x, I highly recommend it.
from node-cmd.
Related Issues (20)
- Real-time command HOT 1
- How to use this to open an exe (Which is a CLI tool) and then fire commands HOT 1
- Output from get not displaying what outputs from the terminal HOT 2
- How to execute commands with ZSH environment HOT 1
- Not Calling Function Callback HOT 1
- Add options to exec HOT 2
- How to get stderr when using promises HOT 1
- async await example? HOT 1
- returns data missing HOT 1
- compgen -c is the only command that does not produce output HOT 1
- Can we run command as adminstrator HOT 1
- Getting stdout streaming HOT 1
- is this project still being maintained? HOT 1
- 苹果笔记本上可以使npm-cmd吗?
- Add get process by Id HOT 2
- Example Error? HOT 4
- Promise API? HOT 2
- answering to a CMD y/n prompt HOT 2
- how to kill a node-cmd process ?
- How do I run command with admin ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-cmd.