summarylogtreecommitdiffstats
path: root/.run.sh
blob: 26b2bfb3c8055090cd69bd436fbaad150eacc9fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

if [ -z "$1" ]; then
	/usr/bin/flax
elif [ $1 == "-new" ]; then
	which zenity
	[ $? -ne 0 ] && exit 1
	_PROJNAME=$(zenity --entry --title="Flax project name" --text="Enter project name:" --entry-text "NewProject")
	[ $? -ne 0 ] && exit 1
	_PROJPATH=$(zenity  --file-selection --title="Choose a directory" --directory)
	[ $? -ne 0 ] && exit 1
	mkdir $_PROJPATH/$_PROJNAME
	[ $? -ne 0 ] && zenity --warning --text="Project cannot be created, check folder permissions" && exit 1
	cd $_PROJPATH/$_PROJNAME
	/usr/bin/flax -new
else
	/usr/bin/flax -project $1
fi