Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/customink-webops/magic_shell
Provides utility for adding some syntactic sugar to your shell.
https://github.com/customink-webops/magic_shell
Last synced: 3 months ago
JSON representation
Provides utility for adding some syntactic sugar to your shell.
- Host: GitHub
- URL: https://github.com/customink-webops/magic_shell
- Owner: customink-webops
- Created: 2012-05-15T19:33:46.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-11-03T15:23:03.000Z (about 5 years ago)
- Last Synced: 2024-07-01T18:20:27.850Z (4 months ago)
- Language: Ruby
- Size: 44.9 KB
- Stars: 59
- Watchers: 2
- Forks: 22
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-chef - magic_shell_alias, magic_shell_environment - Create a command alias or shell environment variable. (Resources / Commands/Scripts)
README
magic_shell Cookbook
====================
[![Build Status](https://secure.travis-ci.org/customink-webops/magic_shell.png)](http://travis-ci.org/customink-webops/magic_shell)Provides utility for adding some syntactic sugar to your shell.
Usage
-----
Update the `metadata.rb` for your cookbook to depend on magic_shell```ruby
depends 'magic_shell'
```Use the `magic_shell_alias` resource to create a command alias.
```ruby
magic_shell_alias 'myrailsapp' do
command 'cd /opt/myrailsapp/current'
end
```This will alias `myrailsapp` to `cd /opt/myrailsapp/current`.
You can also remove aliases:
```ruby
magic_shell_alias 'myrailsapp' do
action :remove
end
```Use the `magic_shell_environment` resource to create a shell environment variable.
```ruby
magic_shell_environment 'EDITOR' do
value 'vim'
end
```This will export an `EDITOR` environment variable with a value of `vim`.
You can also remove environment variables:
```ruby
magic_shell_environment 'EDITOR' do
action :remove
end
```Userspace environment variables and permissions for security or virtualenvs
```ruby
magic_shell_environment 'EDITOR' do
value 'vim'
owner 'username'
group 'groupname'
mode '0600'
destination '/home/user/.profile.d/'
end
```Contributing
------------
1. Fork the repo
2. Create a feature branch
3. Code, document, write specs, test
4. Submit a PRLicense & Authors
-----------------
- Author: Nathen Harvey
- Author: Seth Vargo```text
Copyright 2012-2014 CustomInk, LLC.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```