3
I would like to create a file . bat to automate a process I have to perform every day.
Whenever I start working, I open the nodejs terminal, access my project directory (in my case I use Babel) and then, I need to execute the command npm run babel
.
The problem is I work on more than one project. Then sometimes I have to navigate through the terminal to the directory and then run the command to start Babel.
I would like to create a file . bat for each project, to already leave everything configured and when I click the file . Project bat I want, it opens the node terminal and execute the commands I want. This is possible?
It is possible yes, just create the bat file with the commands you want to run. Do you have difficulty creating the file? Just go putting the commands you want it to run, 1 per line, in order. PS if you believe you’re wasting time typing a long way into
cd
, maybe it is better to create shortcuts for folders in home dir.– rodorgas
Yes. I have no experience in creating this type of archive. I tried some examples I found on the internet, but I was unsuccessful. What I wanted to know is which command should I use to open the nodejs terminal and how should I place the npm commands inside that file.bat?
– alan
Actually, I don’t think there’s anything called the "nodejs terminal," and inside the . bat vc puts the commands exactly the same you type in cmd, it doesn’t change anything. I don’t know if I got it wrong but I added an answer, see if that’s what you need
– rodorgas