Permalink
Browse files

symlink coming back to yii

  • Loading branch information...
1 parent b0e798a commit 656b8793343cc1bac2c39dab6877304734b78162 @phunehehe committed Jan 14, 2013
Showing with 12 additions and 6 deletions.
  1. +12 −6 yii/definitions/yii_framework.rb
@@ -5,20 +5,26 @@ class Chef::Recipe
define :yii_framework do
- yii_version = params[:name]
- yii_path = params[:path] || yii_default_path(yii_version)
+ version = params[:name]
+ path = params[:path] || yii_default_path(version)
+ symlink = params[:symlink]
- directory File.dirname(yii_path) do
+ directory File.dirname(path) do
action :create
recursive true
end
bash 'install-yii' do
code <<-EOH
- [[ -d #{yii_path} ]] || git clone https://github.com/yiisoft/yii.git #{yii_path}
- cd #{yii_path}
+ [[ -d #{path} ]] || git clone https://github.com/yiisoft/yii.git #{path}
+ cd #{path}
git fetch
- git checkout #{yii_version}
+ git checkout #{version}
EOH
end
+
+ link symlink do
+ to path
+ only_if { symlink }
+ end
end

0 comments on commit 656b879

Please sign in to comment.