UOLI
Quickly switch between projects, changing the HOSTS file and the Templatecache templates
Just run uoli project-a
or uoli project-b
to change you TCL templates and HOSTS file for the given projects
Pre requisites
- You will need to have Node.js installed on your machine
- Define the environment variable
TCLPATH
heading to the templatecache-local root dir, e.g./Users/{username}/templatecache-local
orC:\templatecache-local
- Create a directory to store your HOSTS files, e.g.
/Users/{username}/hosts
orc:\hosts
- Define the environment variable
HOSTSPATH
heading to the HOSTS directory you have created - Make sure you have administration permissions in the following files and directories:
- Templatecache-local directory
- Your HOSTS directory
- the HOSTS file
Instalation
- Run
$ npm install uoli -g
- Mac users may need to run it with sudo
Usage
Create a project:
To create a new project, set your HOSTS
file and templates
directory the way you want your project to be and run:
-
$ uoli create foo
- This will:
- Copy your current
HOSTS
file content into afoo.hosts
file created on your HOSTS directory - Copy your current
templates
directory content into atemplates-foo
directory created on your TCL
- Copy your current
- This will:
-
$ uoli create foo tc
or$ uoli create foo host
- Will do only the
tc
or thehosts
parts, respectively
- Will do only the
Switch projects
After creating your projects, you can switch between them, running:
-
$ uoli foo
- This will:
- Copy the
foo.hosts
content into yourHOSTS file
- Create a symbolic link from the
templates-foo
directory to thetemplates
directory
- Copy the
- This will:
-
$ uoli foo tc
or$ uoli foo host
- Will do only the
tc
or thehosts
parts, respectively
- Will do only the