Commit 4153cda1 authored by James Larrowe's avatar James Larrowe Committed by Ed Reel

Added crew_profile as an optional package. (#2539)

* Added crew_profile as an optional package.

Does support bash, zsh, and fish, but not all 3 at the same time.

* Added end keyword. Oops!

* Make #{CREW_PREFIX}/etc/profile a symbolic link to ~/.profile

* Does not overwrite previously set configuration.

Creates symlink from #{HOME}/.profile to #{CREW_DEST_PREFIX}/etc/profile

Has postinstall that works with 3 shells.

* Fix fish syntax

* Changed #{HOME} to $HOME

* Changed crew_profile.rb to correlate with the crew version

* Changed version number to 1

* Changed $HOME back to #{HOME}

* Solved $HOME not being defined. Changed some things.

* Falling back to what works. Also added .lightblue to 'touch ~/.profile'

* Uses #{ENV['HOME']} at @uberhacker's requests instead of using hacky workarounds.
parent f40a36d5
require 'package'
class Crew_profile < Package
description 'A profile for Chromebrew, to be used instead of ~/.*rc'
homepage 'https://github.com/skycocker/chromebrew'
version "1"
source_url 'https://github.com/skycocker/chromebrew/raw/511ee9cb3138e113df74ddf0dee057ef5d9a46fd/README.md'
source_sha256 '27b201cec82d903a1856972e6d7ff1ac58a67c761d729ecd7fd14f24fa9d9901'
depends_on "xdg_base"
def self.install
system "mkdir", "-p", "#{CREW_DEST_PREFIX}/etc"
system "mkdir", "-p", "#{CREW_DEST_HOME}"
system "ln", "-s", "#{ENV['HOME']}/.profile", "#{CREW_DEST_PREFIX}/etc/profile"
end
def self.postinstall
puts
puts "Works with Bash, Zsh, and Fish".lightblue
puts
puts "To create your very own Crew profile, please execute this:".lightblue
puts
puts "touch ~/.profile".lightblue
puts
puts "For Bash, execute this:".lightblue
puts
puts "echo \"if [ -f #{CREW_PREFIX}/etc/profile ]; then\" >> ~/.bashrc".lightblue
puts "echo \" # Source crew profile\" >> ~/.bashrc".lightblue
puts "echo \" source #{CREW_PREFIX}/etc/profile\" >> ~/.bashrc".lightblue
puts "echo \"fi\" >> ~/.bashrc".lightblue
puts "source ~/.bashrc".lightblue
puts
puts "For Zsh, execute this:".lightblue
puts
puts "echo \"if [ -f #{CREW_PREFIX}/etc/profile ]; then\" >> ~/.zshrc".lightblue
puts "echo \" # Source crew profile\" >> ~/.zshrc".lightblue
puts "echo \" source #{CREW_PREFIX}/etc/profile\" >> ~/.zshrc".lightblue
puts "echo \"fi\" >> ~/.zshrc".lightblue
puts "source ~/.zshrc".lightblue
puts
puts "For Fish, execute this:".lightblue
puts
puts "echo \"if [ -f #{CREW_PREFIX}/etc/profile ]\" >> ~/.config/fish/config.fish".lightblue
puts "echo \" # Source crew profile\" >> ~/.config/fish/config.fish".lightblue
puts "echo \" source #{CREW_PREFIX}/etc/profile\" >> ~/.config/fish/config.fish".lightblue
puts "echo \"end\" >> ~/.config/fish/config.fish".lightblue
puts "source ~/.config/fish/config.fish".lightblue
puts
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment