A
A
Alexey Yarkov2016-05-24 11:53:12
linux
Alexey Yarkov, 2016-05-24 11:53:12

Building the frontend with a bash script. How?

The frontend turnip is connected as a submodule to the Node.js application turnip. After I do a git pull on the main turnip on VDS, I need to build the front. Wrote a script:

$ git submodule foreach git pull origin master
$ cd frontend
$ npm install
$ bower install --allow-root
$ gulp build
$ cd ..

The idea is to go to the folder with the front and run the assembly, and then return to your main folder. But the script does not go to the frontend folder and the script is not executed (does not find bower.json) . CHADNT? If you manually execute the commands in turn, then everything is OK.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Mikhalev, 2016-05-24
@yarkov

use full paths, not relative ones.
if you add pwd > ~/mydir.txt to the script, you will understand what I'm talking about...
accordingly, you need to replace the cd frontend command with cd /path/to/frontend

T
toxa82, 2016-05-24
@toxa82

git submodule foreach git pull origin master
Это не правильно, так вы можете обновить сабмодуль до коммита на который еще не указывает основной репозиторий и получить ошибку в работе.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question