Skip to content

Instantly share code, notes, and snippets.

@peterjaap
Created January 16, 2013 10:52
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save peterjaap/4546320 to your computer and use it in GitHub Desktop.
Save peterjaap/4546320 to your computer and use it in GitHub Desktop.
Quickly generate modman file for Magento extensions
for i in `find . -type f | grep -v \.git | grep -v "^.$" | grep -v "modman" | sed 's/\.\///'`; do echo ${i} ${i}; done > modman
@amenk
Copy link

amenk commented Jul 4, 2013

Hm - some heuristics to link full folders like app/code/local/Foo/Bar or template subfolders would be great

@greenwellness
Copy link

This should more or less give you what you want. It's a fairly consistent pattern of about 2 levels predictable format which can be dropped (since you know them to be there anyway) and take the next levels up to 3 levels max. You'll need tree for this one though and it took me about 2 mins to write up so .. not too sophisticated. Add paths to the array, change the level, inner loop stuff etc as you please

(declare -a tt && tt=( app/design app/code app/etc skin/frontend ) &&\
 for t in "${tt[@]}"; do tree -fi -L 3 --noreport $t | awk 'NR > 2 { print $0 " " $0 }'; done)\
  > modman  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment