We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Simple BASH script to create new symlinks

Development and Programming

Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

Hey guys,

Some of you might know that I have been playing with GitHub and trying to figure out how to have separate repos for each extension without them clobering each other.

In the end the best approach I could come up with is keeping every EE addon in its repo outside of the the core EE install and creating symlinks to the files inside the EE install.

Although not difficult, creating the symlinks for every extension everytime you install them into a new project becomes tedious.

Cutting to the chase I wrote this example BASH script that will do it for you and I thought I would post it on the forum for everyone to modify / use. Just throw it in a new file and set execute perms and you will be good to go.

#!/bin/bash
 
# This script creates symlinks from the local GIT repo into your EE install. It also copies some of the extension icons.
 
dirname=`dirname "$0"`
 
echo "Enter the path to your ExpressionEngine Install without a trailing slash [ENTER]:"
read ee_path
echo "Enter your system folder name [ENTER]:"
read ee_system_folder

# create sym links
ln -s "$dirname"/system/extensions/ext.lg_data_matrix_ext.php "$ee_path"/"$ee_system_folder"/extensions/ext.lg_data_matrix_ext.php
ln -s "$dirname"/system/language/english/lang.lg_data_matrix_ext.php "$ee_path"/"$ee_system_folder"/language/english/lang.lg_data_matrix_ext.php
ln -s "$dirname"/themes/cp_themes/default/lg_data_matrix "$ee_path"/themes/cp_themes/default/lg_data_matrix

# copy global cp images to install
cp "$dirname"/themes/cp_global_images/* "$ee_path"/themes/cp_global_images

You can also see the latest script for LG Data Matrix on my github account

       
timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty

Thanks for sharing Leevi, this is hugely helpful. Putting addons on GitHub is great step in the right direction.

       
Make Things Studio's avatar
Make Things Studio
4 posts
16 years ago
Make Things Studio's avatar Make Things Studio

Great script. I’ve been looking into doing something similar, or also trying to figure out a way to get EE to acccept a user-specified directory for additional add ons. That way the standard EE files can be kept un-edited and in an external subversion repository.

       
timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty

A user specified directory would be great, especially if the addons within could self contained. This would make updating addons a ton easier. Related: http://ellislab.com/forums/viewthread/103198/

       
Make Things Studio's avatar
Make Things Studio
4 posts
16 years ago
Make Things Studio's avatar Make Things Studio

Yeah, this is what i’ve been thinking about too. Today I had a discussion with someone about keeping EE in svn and using svn:externals across projects to make updating a snap. unfortunately the current structure doesn’t allow it. I’m not solid enough in EE to develop one myself, so i’ve just been using manual symlinks to languages/, modules/, plugins/, and extensions/.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

I mentioned something about keeping 3rd-party addons in their own directories (albeit within the directory of their type) way back in 2006. I had just come off a project that used Zencart, and all the template overrides lived in certain directories that were easy to find.

I think at least grouping the non-core add-ons into a specified directory might be useful.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.