{"id":15673063,"url":"https://github.com/jfrux/cfenv","last_synced_at":"2025-05-06T22:21:37.100Z","repository":{"id":11556697,"uuid":"14042761","full_name":"jfrux/cfenv","owner":"jfrux","description":"Groom your app's CFML development environments.","archived":false,"fork":false,"pushed_at":"2014-11-07T19:10:57.000Z","size":65632,"stargazers_count":15,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T03:32:04.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfrux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-01T12:40:38.000Z","updated_at":"2017-06-21T20:54:22.000Z","dependencies_parsed_at":"2022-09-23T00:01:42.268Z","dependency_job_id":null,"html_url":"https://github.com/jfrux/cfenv","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fcfenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fcfenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fcfenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fcfenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfrux","download_url":"https://codeload.github.com/jfrux/cfenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252777352,"owners_count":21802588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T15:36:27.214Z","updated_at":"2025-05-06T22:21:37.076Z","avatar_url":"https://github.com/jfrux.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Groom your app’s CFML dev environment with cfenv.\n\nUse cfenv to pick a Railo version for your application and ensure \nthat your development environment matches production.\n\n**Truly empowering.** Specify your app's Railo version once, in a single file. \nKeep all your teammates on the same page. No headaches running apps on different versions of Railo. \nJust Works™ from the command line. Override the Railo version anytime: just set an environment variable.\n\n**It just works.** cfenv is concerned solely with managing and switching Railo versions. It's simple and predictable.\n\n## Table of Contents\n\n* [Installation](#installation)\n  * [Basic GitHub Checkout](#basic-github-checkout)\n    * [Upgrading](#upgrading)\n  * [Homebrew on Mac OS X](#homebrew-on-mac-os-x)\n  * [Installing Railo Versions](#installing-railo-versions)\n  * [Uninstalling Railo Versions](#uninstalling-railo-versions)\n* [How It Works](#how-it-works)\n  * [Understanding PATH](#understanding-path)\n  * [Understanding Shims](#understanding-shims)\n  * [Choosing the Railo Version](#choosing-the-railo-version)\n  * [Locating the Railo Installation](#locating-the-railo-installation)\n* [Command Reference](#command-reference)\n  * [cfenv local](#cfenv-local)\n  * [cfenv global](#cfenv-global)\n  * [cfenv start](#cfenv-start)\n  * [cfenv shell](#cfenv-shell)\n  * [cfenv versions](#cfenv-versions)\n  * [cfenv version](#cfenv-version)\n  * [cfenv rehash](#cfenv-rehash)\n  * [cfenv which](#cfenv-which)\n  * [cfenv whence](#cfenv-whence)\n* [Development](#development)\n  * [License](#license)\n\n## Installation\n\nIf you're on Mac OS X, consider\n[installing with Homebrew](#homebrew-on-mac-os-x).\n\n### Basic GitHub Checkout\n\nThis will get you going with the latest version of cfenv and make it\neasy to fork and contribute any changes back upstream.\n\n1. Check out cfenv into `~/.cfenv`.\n\n    ~~~ sh\n    $ git clone https://github.com/joshuairl/cfenv.git ~/.cfenv\n    ~~~\n\n2. Add `~/.cfenv/bin` to your `$PATH` for access to the `cfenv`\n   command-line utility.\n\n    ~~~ sh\n    $ echo 'export PATH=\"$HOME/.cfenv/bin:$PATH\"' \u003e\u003e ~/.bash_profile\n    ~~~\n\n    **Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`.\n\n    **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`.\n\n3. Add `cfenv init` to your shell to enable shims and autocompletion.\n\n    ~~~ sh\n    $ echo 'eval \"$(cfenv init -)\"' \u003e\u003e ~/.bash_profile\n    ~~~\n\n    _Same as in previous step, use `~/.bashrc` on Ubuntu, or `~/.zshrc` for Zsh._\n\n4. Restart your shell so that PATH changes take effect. (Opening a new\n   terminal tab will usually do it.) Now check if cfenv was set up:\n\n    ~~~ sh\n    $ type cfenv\n    #=\u003e \"cfenv is a function\"\n    ~~~\n\n5. Install a Railo version.\n   [Installing new Railo versions](#installing-railo-versions).\n\n#### Upgrading\n\nIf you've installed cfenv manually using git, you can upgrade your\ninstallation to the cutting-edge version at any time.\n\n~~~ sh\n$ cd ~/.cfenv\n$ git pull\n~~~\n\nTo use a specific release of cfenv, check out the corresponding tag:\n\n~~~ sh\n$ cd ~/.cfenv\n$ git fetch\n$ git checkout v0.0.5\n~~~\n\nIf you've [installed via Homebrew](#homebrew-on-mac-os-x), then upgrade\nvia its `brew` command:\n\n~~~ sh\n$ brew update\n$ brew upgrade cfenv railo-build\n~~~\n\n### Homebrew on Mac OS X\n\nAs an alternative to installation via GitHub checkout, you can install\ncfenv using the [Homebrew](http://brew.sh) package\nmanager on Mac OS X:\n\n~~~\n$ brew tap joshuairl/homebrew-cfenv\n$ brew update\n$ brew install cfenv\n~~~\n\nAfterwards you'll still need to add `eval \"$(cfenv init -)\"` to your\nprofile as stated in the caveats. You'll only ever have to do this\nonce.\n\nMac OS X\n~~~\n$ nano ~/.bash_profile\n~~~\n\nUbuntu-desktop / Linux Distros\n\n~~~\n\n~~~\n\n### Neckbeard Configuration\n\nSkip this section unless you must know what every line in your shell\nprofile is doing.\n\n`cfenv init` is the only command that crosses the line of loading\nextra commands into your shell. Coming from RVM, some of you might be\nopposed to this idea. Here's what `cfenv init` actually does:\n\n1. Sets up your shims path. This is the only requirement for cfenv to\n   function properly. You can do this by hand by prepending\n   `~/.cfenv/shims` to your `$PATH`.\n\n2. Installs autocompletion. This is entirely optional but pretty\n   useful. Sourcing `~/.cfenv/completions/cfenv.bash` will set that\n   up. There is also a `~/.cfenv/completions/cfenv.zsh` for Zsh\n   users.\n\n3. Rehashes shims. From time to time you'll need to rebuild your\n   shim files. Doing this automatically makes sure everything is up to\n   date. You can always run `cfenv rehash` manually.\n\n4. Installs the sh dispatcher. The sh dispatcher doesn't do\n   anything crazy like override `cd` or hack your shell prompt, but if\n   for some reason you need `cfenv` to be a real script rather than a\n   shell function, you can safely skip it.\n\nRun `cfenv init -` for yourself to see exactly what happens under the\nhood.\n\n### Installing Railo Versions\n\nThe `cfenv install` command downloads, and installs Railo Express versions for you.\n\n~~~ sh\n# list all available versions:\n$ cfenv install -l\n\n# install a Railo version:\n$ cfenv install 4.1.1.009\n~~~\n\n### Uninstalling Railo Versions\n\nAs time goes on, Railo versions you install will accumulate in your\n`~/.cfenv/versions` directory.\n\n~~~ sh\n# uninstall a railo version\n$ cfenv uninstall 4.1.1.009\n~~~\n\nYou can also remove old Railo versions by `rm -rf` the directory of the\nversion you want to remove. You can find the directory of a particular\nRailo version with the `cfenv prefix` command, e.g. `cfenv prefix\n4.1.1.009`.\n\n### Starting a Railo Context\n\nOnce you have an installed version of Railo and have set it globally or locally for a project.\nYou can start the web server for your project with the `cfenv start` command.\n\n~~~ sh\n# start a railo web server in the current directory\n$ cfenv start\n~~~\n\nYou can also specify a custom port if the default `8888` just won't due.\n\n~~~ sh\n# define a custom port for the web server\n$ cfenv start -p 3000\n~~~\n\n## How It Works\n\nAt a high level, cfenv intercepts Railo commands using shim\nexecutables injected into your `PATH`, determines which Railo version\nhas been specified by your application, and passes your commands along\nto the correct Railo installation.\n\n### Understanding PATH\n\nWhen you run a command like `railo_init`, your operating system\nsearches through a list of directories to find an executable file with\nthat name. This list of directories lives in an environment variable\ncalled `PATH`, with each directory in the list separated by a colon:\n\n    /usr/local/bin:/usr/bin:/bin\n\nDirectories in `PATH` are searched from left to right, so a matching\nexecutable in a directory at the beginning of the list takes\nprecedence over another one at the end. In this example, the\n`/usr/local/bin` directory will be searched first, then `/usr/bin`,\nthen `/bin`.\n\n### Understanding Shims\n\ncfenv works by inserting a directory of _shims_ at the front of your\n`PATH`:\n\n    ~/.cfenv/shims:/usr/local/bin:/usr/bin:/bin\n\nThrough a process called _rehashing_, cfenv maintains shims in that\ndirectory to match every Railo command across every installed version\nof Railo—`railo_init` only at this point.\n\nrailo_init is responsible for creating and/or starting a Railo context within the current directory.\nWe will be adding other separate command line tools for Railo and CFWheels framework at later date.\nShims are lightweight executables that simply pass your command along\nto cfenv. So with cfenv installed, when you run, say, `railo_init`, your\noperating system will do the following:\n\n* Search your `PATH` for an executable file named `railo_init`\n* Find the cfenv shim named `railo_init` at the beginning of your `PATH`\n* Run the shim named `railo_init`, which in turn passes the command along to\n  cfenv\n\n### Choosing the Railo Version\n\nWhen you execute a shim, cfenv determines which Railo version to use by\nreading it from the following sources, in this order:\n\n1. The `CFENV_VERSION` environment variable, if specified. You can use\n   the [`cfenv shell`](#cfenv-shell) command to set this environment\n   variable in your current shell session.\n\n2. The first `.railo-version` file found by searching the directory of the\n   script you are executing and each of its parent directories until reaching\n   the root of your filesystem.\n\n3. The first `.railo-version` file found by searching the current working\n   directory and each of its parent directories until reaching the root of your\n   filesystem. You can modify the `.railo-version` file in the current working\n   directory with the [`cfenv local`](#cfenv-local) command.\n\n4. The global `~/.cfenv/version` file. You can modify this file using\n   the [`cfenv global`](#cfenv-global) command. If the global version\n   file is not present, cfenv assumes you want to use the \"system\"\n   Railo—i.e. whatever version would be run if cfenv weren't in your\n   path.\n\n### Locating the Railo Installation\n\nOnce cfenv has determined which version of Railo your application has\nspecified, it passes the command along to the corresponding Railo\ninstallation.\n\nEach Railo version is installed into its own directory under\n`~/.cfenv/versions`. For example, you might have these versions\ninstalled:\n\n* `~/.cfenv/versions/4.1.1.009/`\n* `~/.cfenv/versions/3.0.2.000/`\n* `~/.cfenv/versions/3.3.3.001/`\n\nVersion names to cfenv are simply the names of the directories in\n`~/.cfenv/versions`.\n\n\n## Command Reference\n\nLike `git`, the `cfenv` command delegates to subcommands based on its\nfirst argument. The most common subcommands are:\n\n### cfenv local\n\nSets a local application-specific Railo version by writing the version\nname to a `.railo-version` file in the current directory. This version\noverrides the global version, and can be overridden itself by setting\nthe `CFENV_VERSION` environment variable or with the `cfenv shell`\ncommand.\n\n    $ cfenv local 3.0.2.001\n\nWhen run without a version number, `cfenv local` reports the currently\nconfigured local version. You can also unset the local version:\n\n    $ cfenv local --unset\n\n### cfenv global\n\nSets the global version of Railo to be used in all shells by writing\nthe version name to the `~/.cfenv/version` file. This version can be\noverridden by an application-specific `.railo-version` file, or by\nsetting the `CFENV_VERSION` environment variable.\n\n    $ cfenv global 4.1.1.009\n\nWhen run without a version number, `cfenv global` reports the\ncurrently configured global version.\n\n### cfenv start\n\nStarts a railo web server context within the current directory.\n\n    $ cfenv start\n\nAlso, you can specify the port the server will run on if the default `8888` just won't do.\n\n    $ cfenv start --port 3000\n\n### cfenv shell\n\nSets a shell-specific Railo version by setting the `CFENV_VERSION`\nenvironment variable in your shell. This version overrides\napplication-specific versions and the global version.\n\n    $ cfenv shell 4.1.1.009\n\nWhen run without a version number, `cfenv shell` reports the current\nvalue of `CFENV_VERSION`. You can also unset the shell version:\n\n    $ cfenv shell --unset\n\nNote that you'll need cfenv's shell integration enabled (step 3 of\nthe installation instructions) in order to use this command. If you\nprefer not to use shell integration, you may simply set the\n`CFENV_VERSION` variable yourself:\n\n    $ export CFENV_VERSION=4.1.1.009\n\n### cfenv versions\n\nLists all Railo versions known to cfenv, and shows an asterisk next to\nthe currently active version.\n\n    $ cfenv versions\n      4.1.1.009\n      3.3.3.001\n    * 3.0.2.001\n\n### cfenv version\n\nDisplays the currently active Railo version, along with information on\nhow it was set.\n\n    $ cfenv version\n    4.1.1.009 (set by /Users/joshua/Projects/my_cfml_project/.railo-version)\n\n### cfenv rehash\n\nInstalls shims for all Railo executables known to cfenv (i.e.,\n`~/.cfenv/versions/*/bin/*`). Run this command after you install a new\nversion of Railo, or install a gem that provides commands.\n\n    $ cfenv rehash\n\n### cfenv which\n\nDisplays the full path to the executable that cfenv will invoke when\nyou run the given command.\n\n    $ cfenv which railo_init\n    /Users/joshua/.cfenv/versions/4.1.1.009/bin/railo_init\n\n### cfenv whence\n\nLists all Railo versions with the given command installed.\n\n    $ cfenv whence railo_init\n    4.1.1.009\n    3.3.3.001\n    3.0.2.000\n\n### Special Thanks\n\nA big special thanks to Sam Stephenson (github.com/sstephenson) for building just a great Ruby tool called RBENV.\nWithout it, CFENV would be nothing.\n\n### License\n\n(The MIT license)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrux%2Fcfenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfrux%2Fcfenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrux%2Fcfenv/lists"}