Code Monkey home page Code Monkey logo

modman's Introduction

modman (Module Manager)

Developing extensions for software that doesn't allow you to separate your files from core files, and keeping that extension under version control and making it easy to deploy is now much, much easier. Development of this script was inspired by Magento which forces you to mix your extension files all throughout the core code directories. With modman, you can specify in a text file where you want your directories and files to be mapped to, and it will maintain symlinks for you so that your code is easy to hack and deploy.

All of your cloned/checked-out modules will be kept in a directory named .modman in the location where you run modman init.

Requirements

  • Linux/Unix or OSX (not cygwin, see Windows Users below)
  • bash
  • Common utilities available in your PATH: grep (POSIX), find, ln, cp, basename, dirname
  • Web server must follow symlinks
  • git and/or subversion are optional (not required for "deploy" command)

Magento Users

If using template files in a modman module, you must either:

Option 1:

Use a patched version of Mage/Core/Block/Template.php. This gist is itself a modman module so you can install it by cloning it directly or you can integrate it into your environment some other way.

$ modman clone template-patch https://gist.github.com/35c0d32dd651c4c8c840.git

NOTE: I provide no warranties for using this patch. Use at your own risk!

Option 2:

Enable "Allow Symlinks" (found under System > Configuration > Advanced > Developer).

Allow Symlinks

NOTE: Disabling this security protection does decrease security as it allows template files to be loaded from any location. However, the risk is not so much symlinks as it is specially crafted template paths. The patched Template.php file (Option 1) allows the use of symlinks but should still prevent templates from being loaded from directories other than the app/design directory.

Windows Users

Windows (including cygwin) is not supported by this script, but there is a PHP-port of modman which works on Windows. I am not affiliated with the authors and do not provide support for the PHP port, only a link here for reference.

Installation

To install Modman, you can either install the library in your user's root folder, or you can install Modman globally. Regardless of which option you choose, first run one of these two scripts to download the Modman repo.

bash < <(wget -q --no-check-certificate -O - https://raw.github.com/colinmollenhour/modman/master/modman-installer)

or

bash < <(curl -s -L https://raw.github.com/colinmollenhour/modman/master/modman-installer)

1. Root Folder

If you'd like to keep the script in its native location at ~/bin/, just reload your Bash profile.

source ~/.profile

2. Installing Modman Globally

To make the script global after downloading, move the Modman script to an appropriate script folder, (e.g. /usr/local/bin/ or something similar within /usr/*). Moving it to one of the paths already loaded in your $PATH variable will automatically pick it up without a ~/.profile reload.

mv ~/bin/modman /usr/local/{{ preferred folder }}

And then finally, alias Modman with a symlink if you want something shorter to type (optional)

ln -s /usr/local/{{ preferred folder }}/modman /usr/local/{{ preferred folder }}/{{ symlink }}

Note: modman is simply a bash script, so to use it you just need to place it in your $PATH and change its mode to executable.

Getting Started

Run modman --help to get the basic usage summary or modman --tutorial to see a brief tutorial. For more in-depth information please see the Modman Wiki

Version Control Systems

Modman currently supports subversion and git. Other VCSs could be used by manually checking out the source code into the proper directory and using the "deploy" command.

Author

License

Copyright 2009 Colin Mollenhour

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

modman's People

Contributors

akunzai avatar alex-solovyev avatar cags avatar chvita avatar clockworkgeek avatar colinmollenhour avatar fheyer avatar frosit avatar fuubazbar avatar islandskater43 avatar kubaceg avatar leesaferite avatar mam08ixo avatar maxrice avatar nadavspi avatar npostulart avatar pocallaghan avatar quafzi avatar rhorber avatar robbanl avatar sanbornm avatar silarn avatar silphopp avatar sprankest avatar tmotyl avatar trevormw avatar vdloo avatar vsushkov avatar waynetheisinger avatar yesmeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modman's Issues

--safe-mode / --dry-run Option

It's currently really easy to accidentally delete an entire directory tree simply by forgetting a /* in your modman config. It would be really nice to have a --safe-mode or --dry-run option that we could use that would dry run the install just so we could catch this stuff before wiping out core directories while we're hammering out configuration file for a new module.

Possible feature request?

modman link issue

maybe i am using it wrong.

i have my modman init folder at /var/www/m19_develop
i deploy my repository at /var/www/m19_develop_deploy/

this folder contains one modman file with
@import modules/local/my_module/

the folder /var/www/m19_develop_deploy/modules/local/my_module/ contains another module specific modman file.

when i run now modman link /var/ww/m19_develop_deploy/ it fails with the following error:

ERROR: modman file not found (.modman/m19_develop_deploy/modules/local/my_module/modman):
@import modules/local/my_module

though modman link /var/www/m19_develop_deploy/modules/local/my_module/ works.

is the link feature not able to work with the @import in the modman file?

.gitmodules is not created / updated

Modman does not create an entry in the .gitmodules file when installing a module.
As a result you can no longer update other git submodules in the parent repo.

When executing the git submodule update command:
> git submodule update --init --recursive
You get the following error:
No submodule mapping found in .gitmodules for path '.modman/Cm_Cache_Backend_Redis'

When installing the Cm_Cache_Backend_Redis module:
> modman clone git://github.com/colinmollenhour/Cm_Cache_Backend_Redis.git

I would expect to find the following entry in the .gitmodules file of the parent repo:

[submodule "Cm_Cache_Backend_Redis"]
path = .modman/Cm_Cache_Backend_Redis
url = git://github.com/colinmollenhour/Cm_Cache_Backend_Redis.git

I have added these lines manually for now but I am not sure if this will cause problems further down the track.

Inform the developers to enable "Allow Symlinks" for template settings

If a module has templates, Magento must be aware that this template are symlinked. By default the option is disabled in backend and block the display of templates if they are symlinked which is the case by using modman.

So, just inform other developers to enable this option otherwise problem can occurs. Even if the Web server allow symlinks
Screen shot 2013-01-04 at 16 00 08

Missing 1.9.8 tag

With the latest changes for 1.9.9, modman is broken for us. We wanted to just use 1.9.8 but realized there is no tag for that version. Could you please tag 1.9.8?

modman-installer returns exit status of 2

I'm using puppet to provision a vagrant machine and I'm having trouble with the modman-installer command returning 2 instead of 0 for success.

I've looked at wget's exit codes and it says that an exit code of 2 represents a command line argument parsing error. The installer command within the readme IS indeed correct so this error should not be coming from wget. Do you know of any reason why an exit code of 2 would be returned in modman-installer even if I explicitly end the modman-installer shell script with exit 0?

If interested, here are the puppet commands I'm using:

package { 'wget':
  ensure => present,
}

exec { '/bin/bash < <(wget -O - https://raw.github.com/colinmollenhour/modman/master/modman-installer)':
  creates => "/home/vagrant/bin/modman",
  require => Package['wget'],
}

Relative symlinks problem

Hi. I have a to install a module into an existing symlink.
So modman takes that symlink as a normal folder and the resulting symlink is wrong.

.modman/My_Module/app/code/local/My/ > app/code/local/My
.modman/My_Module2/code/ > app/code/local/My/Module2

I know is not an ordinary situation.

Mercurial Support

I use Mercurial quite a bit and would love to see modman also work with Mercurial.

Since Mercurial is pretty similar to git I was able to change:

git clone --recursive "$src" $@ "$module" && success=1

with:

hg clone "$src" $@ "$module" && success=1

and have the modman clone ssh://mypath work.

This obviously replaces git and isn't a good solution.

Three solutions I thought of:

  1. Have another keyword like you have done with Subversion "checkout/clone" the repository for mercurial. Maybe modman hgclone.
  2. Have modman clone detect the SCM type based on the path or url?
  3. Set SCM options from a config file? Maybe in the .modman folder?

I would write this one in myself but my bash foo is kind of rusty. I would love to help test it out though.

Edit: Almost forgot, we would also need to make sure update-all/update function with the appropriate SCM.

No such file or directory when installing modman

I try to install on our virtual private server with the following command:

bash < <(wget -O - https://raw.github.com/colinmollenhour/modman/master/modman-installer)

Please see the terminal output below. The bin folder stays empty (there is no modman file in it). Am I missing something?

--2014-08-14 16:13:21--  https://raw.github.com/colinmollenhour/modman/master/modman-installer
Resolving raw.github.com... 23.235.43.133
Connecting to raw.github.com|23.235.43.133|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/colinmollenhour/modman/master/modman-installer [following]
--2014-08-14 16:13:22--  https://raw.githubusercontent.com/colinmollenhour/modman/master/modman-installer
Resolving raw.githubusercontent.com... 23.235.43.133
Connecting to raw.githubusercontent.com|23.235.43.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 630 [text/plain]
Saving to: “STDOUT”

100%[====================================================>] 630         --.-K/s   in 0s      

2014-08-14 16:13:22 (22.2 MB/s) - written to stdout [630/630]

chmod: cannot access `/root/bin/modman': No such file or directory
Done. Modman installed in /root/bin/modman

--copy incorrectly reports conflict

When it comes to packaging an extension I need the hardlinks in place, otherwise we package the symlinks by accident -- If anyone knows a way around this, please let me know! To do this, I perform the following commands:

find . -type l | xargs rm
modman deploy diymage --copy

This gives me the following error:

$ modman deploy diymage --copy                                                         
CONFLICT: /Users/nrj/Sites/meanbee/module_diymage/1_7_0_2/app/code/community/Meanbee/Diy already exists.
Run with --force to force removal of existing files.

Yet the app/code/community/Meanbee folder is empty:

$ ls -al app/code/community/Meanbee 
total 0
drwxr-xr-x  2 nrj  staff   68 12 Dec 17:24 .
drwxr-xr-x  4 nrj  staff  136 12 Dec 15:14 ..

My next step is, as the inline help suggests, is to append --force. No luck:

$ modman deploy diymage --copy --force                                             
CONFLICT: /Users/nrj/Sites/meanbee/module_diymage/1_7_0_2/app/code/community/Meanbee/Diy already exists.
Run with --force to force removal of existing files.

$ ls -al app/code/community/Meanbee   
total 0
drwxr-xr-x  2 nrj  staff   68 12 Dec 17:24 .
drwxr-xr-x  4 nrj  staff  136 12 Dec 15:14 ..

If you need it, here's my modman file: https://gist.github.com/9a5a097de58baf653c9f. I'm happy to provide more information if it helps.

Add Windows Support

Modman seems to be a neat way to develop Magento apps (or rather, developing Magento apps without it seems like a nightmare).

Sadly, it seems it doesn't currently support Windows/cygwin.

When I try to run it under cygwin, I get

/c/users/Rong/bin/modman: line 725: conditional binary operator expected
/c/users/Rong/bin/modman: line 725: syntax error near =~' /c/users/Rong/bin/modman: line 725:if ! [[ "$action" =~ $REGEX_ACTION ]]; then'

Has anyone tried using modman under Windows? Perhaps by installing some other 3rd party software / tweaking my cygwin config?

How to use modman on multi-server deployments?

I am using AWS Elastic Beanstalk. This, and almost all other, multi server deployment requires all of the code to be in a .git repo, that can be updated, and then deployed all servers in the cluster at once.

My problem is that modman creates .git folders under .modman/extension_name folder, so all of this source code is automatically omitted when committing, and pushing changes.

I can, of course, manually connect to EC2 or similar instances and run modman commands from there, but it defies logic, as it disrupts the whole automatic scaling concept that large scale magento shops require.

Please advise.

Modman reverse

Hi Colin, I'm developing another feature on my fork which I'll do as a pull request when finished, I'm commenting here in case you or others have got comments whilst I'm writing the code.

Basically its a modman reverse function: The use case for this feature is for when you've been developing code in locations actually within your main Mage application rather than in a modman module, but you now decide you want to move the code into a modman module.

To use the new feature you simple need to write a modman file in an empty modman module (ie one that contains no files). You then call modman reverse modulename. Modman reads the modman file and copies all the contained paths into the modman module's folder from the main Mage directory.
modmanreverse

modman link --copy question/issue

  1. run "modman link --copy Testmodule"
  2. run "modman deploy-all" and you got:
CONFLICT: directory already exists and is not a symlink:
 app/code/local/Vendor/Testmodule/* app/code/local/Vendor/Testmodule/
(Run with --force to force removal of existing files and directories.)
Error occurred while deploying 'testmodule'.

Deployed all modules with 0 errors.

So my question is how I should deploy module changes correctly in this case?
logical that if the module was "installed" with flag "--copy" it should be also "copied" after "deploy" command.
I just want to get rid of symlinks! :)

p.s. Message "Deployed all modules with 0 errors" seems incorrect, because there was an error :)

Readme Refinement - Magento Admin Location Addition

For Magento, if using template files in a modman module, you must enable "Allow Symlinks"

I suggest adding the following to this statement:

For Magento, if using template files in a modman module, you must enable "Allow Symlinks" under system->configuration->advanced->developer.

This will make it much easier for people who may have not seen that setting before.

Thanks!

Error with grep command while repair

repairing links, do not interrupt.
grep: invalid option -- z
usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ]

I've removed z option and all works correct for me

Create relative symlinks

I'm not complete sure if I'm using modman right or if this is even possible

I have symlinks in my installation with an absolute path (which is of course different that the production environment): http://cl.ly/FIJz

Is it maybe possible to create relative symlinks instead of absolute symlinks, that way I do not have to run anything when I deploy the project (server doesn't allow for installation of modman).

I saw an earlier which should do exactly this, but I cant seem to find any changes about this in the current source: http://code.google.com/p/module-manager/issues/detail?id=11

Deploy --copy fails on OS X

Illegal options with both mkdir and cp when trying to deploy --copy. Change to:

mkdir -p

and

cp -R

However it looks like OS X doesn't support -link, so this wouldn't use hardlinks.

You must specify a source for the 'clone' command.

Hi,
I have a strange issue in Debian.

If you try modman clone .... (like modman clone git://github.com/colinmollenhour/magento-cache-benchmark.git) , I get the following error:

You must specify a source for the 'clone' command.

Can you help?

Thank you!

Dry Run

It would be nice to have a dry run option, so you could check overall what changes would be made.

perhaps rsync verbage:
-n, --dry-run perform a trial run with no changes made

Thanks for the awesome tool.

Using modman with Magento Connect modules?

I really like modman but now I'd like to use it with a module that is only available via Magento Connect. Is there a way to do this quickly or will I have to create a modman file with all the relevant paths manually?

Installer

Is the $HOME variable needed?

on most linux installs I would think it should install /bin/modman vs /username/bin/modman

It caused me issues in my install, I had to run the bash commands manually to install it.

Feature request: prefix links to be removed with dash/minus sign (-)

When using modman sometimes I'd like to have a symlink removed. I think the easiest way to do this would be to add support for this in the modman configuration file. I'd suggest prefixing such lines with a dash/minus sign (-). The modman file could then e.g. look like this (in case of a typo):

MyCompany/MyModule app/code/community/MyCompany/MyModule
-MyCommmmmmpany/MyModule app/code/community/MyCommmmmmpany/MyModule

gitmodules support

hey,

is there a way to support auto create a submodule file for git?

actualy i create the file manualy...
git submodules also support git-svn and git-hg

Symlinks 1 level too deep.

It seems the relative symbolic links that are made are one level too deep.

Instead of ../../../../.modman/my/files/here (four levels up), it should be ../../../.modman/my/files/here.

I tried the version @Caprico85 has and I was able to get the right amount. However, my symlinks still aren't working. For some reason, even though the path in the symlink is good, it doesn't work.

I tried to figure out if the path was wrong by going to the symlink's folder and manually creating the symlink but not even autocompletion allows me to pull up my module's folder under the .modman folder. I'm able to use tab completion up to that point. The name of my module doesn't contain any special characters. I looked to see if maybe it was a folder permission error but it doesn't appear to be. Anyone else having these issues?

In tutorial

https://github.com/colinmollenhour/modman/wiki/Tutorial

Does trailing slash in your example matter? See

frontend/layout/* app/design/frontend/base/default/layout/ frontend/template/* app/design/frontend/base/default/template/mymodule

Also, how can this be done?
app/design/frontend/base/default/layout/* app/design/frontend/base/default/layout

We have see cases where the whole directory strcuture app/design/frontend/base/default/layout was one after modman

2 or more modules for same company

I have created 2 modules with same company in 2 different git repositories.

app/code/local/Company/Module1
app/code/local/Company/Module2

When i try to install 2nd it partially replace the first.
Can you please check this situation.

Feature Request: "devlink"

It'd be cool if there was a modman command called "devlink" (or something similar) that allowed you to use a modman project to link a modman module directly instead of cloning/checking out the code. For example:

With the following folder structure:

myMagentoInstallFolder/
myExternalModmanModules/
    modmanModule1/
    modmanModule2/

Within myMagentoInstallFolder, if modman could create symlinks to myExternalModmanModules/modmanModule1 instead of making a clone of the code within the .modman file then any changes made within the modmanModule1 module would automatically be used. Obviously modman repair may need to be run if the modman file within the modmanModule1 folder were to be modified.

This would allow for a quicker development cycle because the module code wouldn't need to be committed to the repo and then updated by modman within the centralized Magento install folder.

The only alternative that I see at this point is to modify the module code within the .modman folder and then commit it back to the modmanModule1 folder so the repo stays in sync.

I'm no bueno at Bash scripting, otherwise I'd fork and send a pull request.

Modman installation

Hi Colin

Trying to install your extension but I'm not familiar with Modman. I've run the following

modman clone git://github.com/colinmollenhour/modman.git

but am getting errors, the .modman/ dir is created in the magento root but empty. Could you help please? What am I doing wrong?

Cloning into modman...
remote: Counting objects: 383, done.
remote: Compressing objects: 100% (200/200), done.
remote: Total 383 (delta 164), reused 357 (delta 142)
Receiving objects: 100% (383/383), 71.71 KiB, done.
Resolving deltas: 100% (164/164), done.
WARNING: Target does not exist (.modman/modman/modman):
version="1.9.4"
WARNING: Target does not exist (.modman/modman/modman):
script=${0##*/}
WARNING: Target does not exist (.modman/modman/modman):
usage="
WARNING: Target does not exist (.modman/modman/modman):
Module Manager (v$version)
WARNING: Target does not exist (.modman/modman/modman):
Global Commands:
WARNING: Target does not exist (.modman/modman/modman):
$script [--force]
WARNING: Target does not exist (.modman/modman/modman):


WARNING: Target does not exist (.modman/modman/modman):
init [basedir] initialize the pwd (or [basedir]) as the modman deploy root
WARNING: Target does not exist (.modman/modman/modman):
list [--absolute] list all valid modules that are currently checked out
WARNING: Target does not exist (.modman/modman/modman):
status show VCS 'status' command for all modules
WARNING: Target does not exist (.modman/modman/modman):
incoming show new VCS remote changesets for all VCS-based modules
WARNING: Target does not exist (.modman/modman/modman):
update-all update all modules that are currently checked out
WARNING: Target does not exist (.modman/modman/modman):
deploy-all deploy all modules (no VCS interaction)
WARNING: Target does not exist (.modman/modman/modman):
repair rebuild all modman-created symlinks (no updates performed)
WARNING: Target does not exist (.modman/modman/modman):
clean clean up broken symlinks (run this after deleting a module)
WARNING: Target does not exist (.modman/modman/modman):
--help display this help message
WARNING: Target does not exist (.modman/modman/modman):
--tutorial show a brief tutorial on using modman
WARNING: Target does not exist (.modman/modman/modman):
--version display the modman script's version
WARNING: Target does not exist (.modman/modman/modman):
[--force] overwrite existing files, ignore untrusted cert warnings
WARNING: Target does not exist (.modman/modman/modman):
[--no-local] skip processing of modman.local files
WARNING: Target does not exist (.modman/modman/modman):
[--no-clean] skip cleaning of broken symlinks
WARNING: Target does not exist (.modman/modman/modman):
Module Commands:
WARNING: Target does not exist (.modman/modman/modman):
$script [] [--force] [--basedir ] [[--] ]
WARNING: Target does not exist (.modman/modman/modman):


WARNING: Target does not exist (.modman/modman/modman):
checkout checkout a new modman-compatible module using subversion
WARNING: Target does not exist (.modman/modman/modman):
clone checkout a new modman-compatible module using git clone
WARNING: Target does not exist (.modman/modman/modman):
hgclone checkout a new modman-compatible module using hg clone
WARNING: Target does not exist (.modman/modman/modman):
link link to a module that already exists on the local filesystem
WARNING: Target does not exist (.modman/modman/modman):
update update module using the appropriate SCM
WARNING: Target does not exist (.modman/modman/modman):
deploy deploy an existing module (SCM not required or used)
WARNING: Target does not exist (.modman/modman/modman):
remove remove a module (DELETES MODULE FILES)
WARNING: Target does not exist (.modman/modman/modman):
[--force] overwrite existing files, ignore untrusted cert warnings
WARNING: Target does not exist (.modman/modman/modman):
[--no-local] skip processing of modman.local files
WARNING: Target does not exist (.modman/modman/modman):
[--no-clean] skip cleaning of broken symlinks
WARNING: Target does not exist (.modman/modman/modman):
[--basedir ] on checkout/clone, specifies a base for module deployment
WARNING: Target does not exist (.modman/modman/modman):
[--copy] deploy by copying files instead of symlinks
WARNING: Target does not exist (.modman/modman/modman):
[] specify additional parameters to SCM checkout/clone
WARNING: Target does not exist (.modman/modman/modman):
"
WARNING: Target does not exist (.modman/modman/modman):
tutorial="
WARNING: Target does not exist (.modman/modman/modman):
Deploying a modman module:
WARNING: Target does not exist (.modman/modman/modman):


WARNING: Target does not exist (.modman/modman/modman):
The 'checkout' and 'clone' commands are used to checkout new modules from a
WARNING: Target does not exist (.modman/modman/modman):
repository (subversion and git, respectively). These commands support additional
WARNING: Target does not exist (.modman/modman/modman):
arguments which will be passed to the 'svn checkout' and 'git clone' commands.
WARNING: Target does not exist (.modman/modman/modman):
This allows you to for example specify a --username (svn) or a --branch (git).
WARNING: Target does not exist (.modman/modman/modman):
See 'svn help checkout' and 'git help clone' for a full list of options.
WARNING: Target does not exist (.modman/modman/modman):
Both svn:externals and git submodules will be automatically included.
WARNING: Target does not exist (.modman/modman/modman):
To link to modules that already exist on the local file system you can use
WARNING: Target does not exist (.modman/modman/modman):
the 'link' command. The 'update' command will be supported the same as if the
WARNING: Target does not exist (.modman/modman/modman):
module had been created using the checkout or clone command. For example:
WARNING: Target does not exist (.modman/modman/modman):
$ modman link ~/projects/My_Module
WARNING: Target does not exist (.modman/modman/modman):
$ modman update My_Module
WARNING: Target does not exist (.modman/modman/modman):
By default, if a module being checked out contains symlink mappings that
WARNING: Target does not exist (.modman/modman/modman):
conflict with existing files, an error will be thrown. Use --force to cause
WARNING: Target does not exist (.modman/modman/modman):
any existing files or directories that conflict to be removed. Be careful!
WARNING: Target does not exist (.modman/modman/modman):
Writing modman modules:
WARNING: Target does not exist (.modman/modman/modman):


WARNING: Target does not exist (.modman/modman/modman):
Each module should contain a file named "modman" which defines which files
WARNING: Target does not exist (.modman/modman/modman):
go where relative to the directory where modman was initialized.
WARNING: Target does not exist (.modman/modman/modman):
==== Start example modman file ====
WARNING: Target does not exist (.modman/modman/modman):
# Comments are supported, begin a line with a hash
WARNING: Target does not exist (.modman/modman/modman):
code app/code/local/My/Module/
WARNING: Target does not exist (.modman/modman/modman):
design app/design/frontend/default/default/mymodule/
WARNING: Target does not exist (.modman/modman/modman):
# Source and destination can have different names.
WARNING: Target does not exist (.modman/modman/modman):
en_US.csv app/locale/en_US/My_Module.csv
WARNING: Target does not exist (.modman/modman/modman):
# Destination file name is not required if the same as the source.
WARNING: Target does not exist (.modman/modman/modman):
My_Module.xml app/etc/modules/
WARNING: Target does not exist (.modman/modman/modman):
# Leave out the destination entirely to assume the same path as the source.
WARNING: Target does not exist (.modman/modman/modman):
lib/Somelib
WARNING: Target does not exist (.modman/modman/modman):
# Bash extended glob patterns supported.
WARNING: Target does not exist (.modman/modman/modman):
skin/css/* skin/frontend/base/default/css/
WARNING: Target does not exist (.modman/modman/modman):
skin/js/* skin/frontend/base/default/js/
WARNING: Target does not exist (.modman/modman/modman):
# Import another modman module
ERROR: modman file not found (.modman/modman/modules/Fooman_Speedster/modman):
@import modules/Fooman_Speedster
Error trying to clone new module 'modman', operation cancelled.

add remove option

it'll be great to have a command like

modman remove <module>

which basically loops over the definitions in the modman file to delete the deployed files (or symlinks).

readlink issue with *BSD

The same issue as with MacOS X applies to *BSD.

readlink: illegal option -- m
usage: readlink [-fn] [file ...]

A suggestion for autocreation of modman file

Hi Colin,

This is a suggestion, not an issue. How about an autocreate for the modman file? This would be very useful for when people retroactively create a modman file for their module rather than writing one when developing, maybe because it is a third-party module rather than their own.

How it would work

  1. -bash$ modman automodman
  2. the script would traverse the directories below the one it was called from
  3. at each directory level it would print the path and ask include 'folder/path', [y] [n]
  4. if the answer was no but the folder contained files it would then loop through the files asking include folder/path/filename [y] [n]
  5. If the answer was yes to either of the above it would create a simple modman line where both left and right path matched (I think that if users are going have a different folder structure in their modman folder to that in Magento this would still save them half the work of creating a modman file.)
  6. it would proceed to the next directory, either below its current level, or at a sibling level, or by returning to the parent and traversing down to the next in sequence. At each level the process 1 to 4 would be repeated
  7. control C would break operation

What do you think?

Removing conflicting directory issues!

Dear developer,

I was recently trying to implement modman into my GIT magento development environment. I am finding it pretty handy to use, as my modules grew a lot through months of development. However, I would have one small issue to report or more like a "unwanted" feature.

The thing is, modman automatically deletes each directory in Magento main installation if that directory is defined in module's modman file even if there are no conflicting files inside it! For instance:

Magento folder structure:
js/
js/prototype/prototype.js
js/scriptaculous/scriptaculous.js

Custom folder structure:
js/
js/prototype/proto.js
js/scriptaculous/script.js

Modman definition file (option 1):
js/* js/
In that case, both prototype and scriptaculous folder are automatically deleted with all including files and then module's new folders are linked there. This is of course not good solution...

And modman definition file (option 2):
js/.js js/
js/prototype/
.js js/prototype/
js/scriptaculous/*.js js/scriptaculous/
This is the scenario where nothing gets deleted and everything gets mapped as it should. But in that case, too much definitions are necessary. If there only two "existing" folder to define, that's not such a big problem, but if you had 50 folder (for instance translations: en_US, sl_SI, ... or maybe templates/layouts/css/etc...) that would be really painful to define...

At that point I am wondering two things:
1.) If you have a big module there's a nice possibility you will define something wrong in the first attempt, and when you link/clone it to magento installation folder, something gets automatically deleted and that's not ok. Is there an option to tell "modman" in it's current state not to delete anything automatically?

2.) Better alternative would be if you could tell me what would be the right approach to map those existing folders with different files one over another without removing anything, but just mapping all files recursively? for the case above "modman" goes through modules's folder structure and maps each file inside js/scriptaculous and js/prototype (and all other if they exist) to magento folder without removing original folders first. Is that possible to achieve with one definition iin modman file or should I define each folder/file separately?

Thanks in advance for your answer...

Symlinks and git

We store our Magento code in Git, but when we have installed something via modman and made a push the modman files are not stored in git.

It just looks like this inside .modman/ using Bitbucket online:
Aoe_Profiler → 384b6de6443b [384b6de6443b]

It seems the actual files are not uploaded?

Modman Dump

It would be nice to have an option to dump the modman files into the source tree using cp instead of making sym links. This would allow for passing it off to those who do not use LAMP hosting etc.

I have had several developers who are using WAMP, and when I go to hand off work to them, its a pain in the butt. If I could just dump a dev copy for them, flat without the sym-links I think it would really simplify working with the less linux savvy.

Something like deploy-hard or deploy-real.

What do you think?

Directories don't get cleaned up after module deletion

After the deletion of the module in the .modman dir I run modman clean and all the symlinked files got cleaned. But the directories stayed even if they were empty. The same happens if I edit links in the modman file and run modman update-all the new symlinks get updated but the old ones remain.
It would be nice to have an uninstall command to delete modules or that the clean command removes old/empty dirs.
Is there a reason why the dirs are created regularly and not as symlinks like the files?
Thanks for the nice tool which makes magento development much easier.
grossmann

File is empty

The installer doesn't work for me.

I run it but bin/modman is empty...

You need to add --no-check-certificate on wget command line or it wont work.

Folders do not get removed when module is restructured

Say you have a modman file that looks like this.

file1.txt file1.txt
test/file2.txt test/file2.txt
file3.txt file3.txt

and you move file of file2.txt out of the test folder and so then you have a modman file that looks like this:

file1.txt file1.txt
file2.txt file2.txt
file3.txt file3.txt

After you run modman update, the test folder (which is empty and was created by modman in the first place) should be removed. If some other code has created items in this folder, you obviously would not want to remove them but since it is empty and was created by modman, modman should delete it.

This is a minor issue but it would be nice if modman cleaned up after itself.

Root symlink pointing to wrong spot.

I'm trying to deploy the EcomDev_PHPUnit module to my site, but the UnitTest.php symlink keeps pointing to the wrong spot...up one directory from my main site root directory.

ie: UnitTests.php -> ../.modman/EcomDev_PHPUnit/UnitTests.php

should be:

ie: UnitTests.php -> .modman/EcomDev_PHPUnit/UnitTests.php

However, the modman file for the module appears correct where to place the file. Everything else appears to work as expected. I'm using ZShell - not sure if that is affecting anything.

Problem with tput

On a client's server, I get the following output when using modman:
./module-manager/modman: Zeile 223: tput: Kommando nicht gefunden.
./module-manager/modman: Zeile 224: tput: Kommando nicht gefunden.

Maybe it is possible to avoid the usage of tput or check if it is available beforehand...

modman without access to /proc?

Hi,

I would really like to use modman on a Mittwald Managed Server. Unfortunately, I get the following error when running deploy-all:
./module-manager/modman: Zeile 631: /dev/fd/62: Datei oder Verzeichnis nicht gefunden
("File or Directory not found")

Mittwald told me that modman only works with access to /proc and that this access is not available on their systems. Is it possible to use modman without it?

Thanks a lot for all your work!
Cheers,
Simon

stat with irregular argument in osx

You are using stat -c %F on the modman code, but this argument only work on linux. In OSX is stat -f.

Error:
stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.