Permalink
Browse files

fixed up bash script

  • Loading branch information...
1 parent 8bffe79 commit 044b4fe2266afa8f3aca2f4e1340a653a37cb414 @vertiginous committed Feb 8, 2011
Showing with 14 additions and 15 deletions.
  1. +2 −15 bin/pik_install
  2. +12 −0 tools/pik.sh
View
@@ -54,20 +54,7 @@ puts "Installing to #{install_dir}\n\n"
cp File.join(src_dir, 'pik_runner.exe'), install_dir, :verbose => true
cp File.join(src_dir, 'pik.bat'), install_dir, :verbose => true
cp File.join(src_dir, 'pik.ps1'), install_dir, :verbose => true
-
-pikrc_file = File.join(pik_home, '.pikrc')
-pikrc_contents =<<PIKRC
-#!/bin/sh
-pik_path=#{bash_install_dir}
-
-function pik {
- $pik_path/pik_runner.exe pik.sh $@
- [[ -s ~/.pik/pik.sh ]] && source ~/.pik/pik.sh
-}
-PIKRC
-puts
-puts "creating #{pikrc_file}"
-File.open(pikrc_file, 'w+'){|f| f.puts pikrc_contents }
+cp File.join(src_dir, 'pik.sh'), install_dir, :verbose => true
puts "\npik is installed"
@@ -90,6 +77,6 @@ puts
puts bash_msg =<<BASH_MSG
if you want to use pik with git bash, add the following line to your ~/.bashrc:
- [[ -s ~/.pik/.pikrc ]] && source ~/.pik/.pikrc
+ [[ -s #{bash_install_dir}/pik.sh ]] && source #{bash_install_dir}/pik.sh
BASH_MSG
View
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+function pik {
+ pik_runner.exe pik.sh $@
+ if [[ -n "${PIK_HOME}" ]]; then
+ [[ -s $PIK_HOME/pik_run.sh ]] && source $PIK_HOME/pik_run.sh
+ else
+ [[ -s ~/.pik/pik_run.sh ]] && source ~/.pik/pik_run.sh
+ fi
+}
+
+

0 comments on commit 044b4fe

Please sign in to comment.