cmd-plus
An Experiment to Run the Right Sencha Cmd
Dec 1, 2014 · 2 min read
Working on different customers code base is an interesting experience. Not only you deal with different skills, languages, and configurations but also with versions of ExtJS, Touch and even Sencha Cmd.
In order to replicate the exact same environment we usually keep all public versions of Sencha Cmd locally, and then change the .bashrc
file or create an alias to use the right version.
To avoid that process, I created a very simple nodejs utility: cmd-plus
cmd-plus is an experiment to run the Sencha Cmd version based on the project metadata information (sencha.cfg
). It is a simple wrapper for Sencha Cmd, so you can use it transparently by just installing cmd-plus and run it instead of sencha
Install
You only need to install it using npm:
$ sudo npm install -g cmd-plus
Usage
There are a few more options you can run with cmd-plus
List
Shows the list of all current versions available in your system.
You can check your installed versions with:
$ cmd-plus list
4.0.0.161
4.0.3.74
4.0.4.84
5.0.0.114
5.0.0.160
5.0.1.231
5.0.2.274
5.0.3.324
Use [Version] {Sencha Cmd Options}
Uses the given Sencha Cmd version to run the command.
This will generate a new app using cmd version 4.0.4.84
$ cmd-plus use 4.0.4.84 -sdk ../touch-2.4.0 generate app MyApp MyApp
Version
Returns the current cmd-plus version
$ cmd-plus version
cmd-plus v1.0.0
Sencha
Running any other sencha cmd command is transparent:
$ cmd-plus which
This will execute the current installed sencha which
command. But, if you are under a sencha touch / extjs root app folder it will read the ./.sencha/app/sencha.cfg file and use the cmd version from it. If it is not installed it will default to the latest version.
GitHub Repository
You can check the sencha-cmd-plus repository for the latest updates or to report any issues.