Script to setup and run lenses app.
- Clone or download/unzip the repo
- Open terminal and go to the repo directory you just created (e.g.
cd ~/Desktop/utility-scripts
) - Run
./lenes-setup.sh setup
. The clones the UI, installs bower dependencies and runs python SimpleHTTPServer. - Open browser and go to
http://localhost:8008/lenses-freeform/demo.html
(orhttp://localhost:8008/lens-compose/demo.html
for linear version)
NOTE Script installs the files in HOME_DIR/Documents/lenses
. If that directory exists it backs up that directory to lenses.bck
. If both exist setup scrips exits without installing. Remove either directory and run the script again.
There are 4 variables on top of lenses-setup.sh:
ROOT=~/Documents
HOME_DIR="$ROOT/lenses"
COMPOSER="lenses-freeform" #lens-composer
GIT_ORG="lenses" #lenses
ROOT
is where the lenses direcotry will be created. You can change it to~/Desktop
or anything else (~
means your home directory)HOME_DIR
is the name of directory. Keep the$ROOT/
part but you can modifylenses
to any other name.COMPOSER
is the UI version you want: uselenses-freeform
for the freeform version orlens-composer
for linear.GIT_ORG
(Advanced) is the github user/organization which has the composer code. If you forklenses-freeform
orlens-composer
you can change that to your github account.
lenses-setup.sh run-server
runs python server. If you have lenses setup but just want to run http server use this (similar topython -m SimpleHTTPServer 8008
)lenses-setup.sh kill-server
Shuts down the server.lenses-setup.sh update
updates your code base. IMPORTANT NOTE If you have modified the code of UI or one of the already existing components runing update scripts overwrites your changes. If you have only created a new component in a new directory inlenses
folder it will be safe.
- If by running
./lenses-setup.sh setup
you getPermission denied
error trychmod u+x lenses-setup.sh
to give execute permission to script. You might need to dosudo chmod u+x lenses-setup.sh
if former command didn't work (though it is a red flag that there is a problem on your computer setup)
For any other problems please file an issue
- Runs git status on every component directory (e.g. lens-*). Run inside development (e.g. lenses) directory
For Lenses:
find . -name 'lens*' -type d -depth 1 -exec sh -c 'echo "\n \x1B[0;33m CHECKING STATUS IN {} \x1B[0m \n"' \; -exec git -C {} status \;
For Thelma:
find . -name 'th-*' -type d -depth 1 -exec sh -c 'echo "\n \x1B[0;33m CHECKING STATUS IN {} \x1B[0m \n"' \; -exec git -C {} status \;
- Replace all lens-* bower directories with git directories. This script is meant to be run once after bower installing all the componets. (USE WITH CAUTION! It removes the existing lens-* directories)
curl -u [USERNAME] -s https://api.github.com/orgs/lenses/repos?per_page=100 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| exclude_repos = ["thelmacheer", "th-footnote","th-line-graph","th-multistep", "th-two-column","thelma-charts", "thelma", "thelma-component-demo", "thelma-components", "thelma-core", "thelma-data", "thelma-utils", "thelma-text", "thelmanews.github.io"] %x[rm -rf #{repo["name"]}] unless exclude_repos.include?(repo["name"]) %x[git clone #{repo["ssh_url"]} ] end }'
- Clone all lenses repos:
curl -s https://api.github.com/orgs/lenses/repos?per_page=100 | grep ssh_url | grep lens- | sed s/\"ssh_url\"\://g | sed s/\"//g | sed s/,//g | xargs -I {} -n 1 git clone {}