In a small project I'm currently developing, we have this assets.fla
file which was previously hosted under our Git repository. Due to bizarre problems with Git's merge tool and .fla file type (we were losing library symbols, for some reason), we decided to move assets.fla
from our Git repository to the project's folder on Dropbox.
That was a smart move, problems with merge were gone and others could know everytime a update is made. But with the time (one day of working, lol) it was getting kind of annoying. Everytime I wanted to update some asset (generate the .swc file), I needed to edit the export path. There are three of us working on this file, and everybody needed to repeat the same thing every time a change was needed.
So, since I have a problem, where can be the solution? bash
for sure!
Then I wrote a script to automatize this process and it now fits quite well on the project workflow.
To get things working, you need to configure a dotfile on the home folder, pointing to the local Git repository:
echo "/Users/[your_user_name]/[foo_project_path]" > ~/.foo-path
After that, you only need to execute a script which is located in the root of our Dropbox project folder. I'm calling it watch
.
sh watch
Now all the guys working on this file don't need to worry about changing its export path everytime they want to make a change. Just leave the script running in background, do what you have to do, compile the file and commit the changes.
I wanted to share this because it saved us some time and avoided a few problems.
The script basic stays running forever, looking for a hash change on the compiled file. As soon the file is changed, it moves the file from our Dropbox folder to the local Git repository.
I even created a JSFL
kinda wizard to help somebody from the team who doesn't have familiarity with CLI. A one-click solution. Not the case to share it though, just mentioning it.
Check the script below and happy coding.