welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 167 forks source link

Use relative path for local environment #137

Closed delphaber closed 7 years ago

delphaber commented 9 years ago

Commit b0be2f9faf1be4de23222e49dbbf3abb0be34fa7 introduced a note in the Movefile template: "User an absolute path here".

@Arkham do you remember why?

I think that, locally, it could be useful to use relative path when working with other developers

Arkham commented 9 years ago

IIRC it wasn't working :)

whitehat101 commented 9 years ago
local:
  wordpress_path: .

Wordmove was successfully pulling content, with a local path of ".", however the find and replaces yielded incorrect results when pushing.

It seems unreasonable to insist that all developers have absolutely identical setups. I expect that placing the Movefile in the root of the WP project is the most common setup. Why not use the use the absolute location of the Movefile to determine the local.wordpress_pathif a relative path is given? Even better, would be to set the default value of local.wordpress_path to be the directory of the Movefile.

Arkham commented 9 years ago

I guess we never felt the need for this feature, happy to review pull requests if you have time :)

alessandro-fazzi commented 9 years ago

Can't afford to explain myself where's the constraint about

It seems unreasonable to insist that all developers have absolutely identical setups.

we're talking about path; you can develop sites inside /private/etc w/o Wordmove make a single problem about it, AFAIK. Moreover when you create a new project, enter in its folder and invoke wordmove init you'll get an autofilled local -> wordpress_path in order to make it more straightforward.

What am I missing? Is all about the loss of automagic or what else?

Thanks for your clarifications.

connormckelvey commented 9 years ago

In case anyone else is interested, I wrote a node script that you can use as a post-checkout hook with git. https://github.com/connormckelvey/hooks/blob/master/wordmove-post-checkout

It will run when you clone a repository and run when you switch branches. Works pretty well for my team.

alessandro-fazzi commented 9 years ago

I've opted to write down a little wiki entry w/ your contribuition here.

It would be great to have some more details about the script. E.g. I've scanned the code and I have a little question: what it does if I'll checkout a branch from inside a subdirectory?

Anyway your idea is just really appreciated: we like very much workflow oriented tips ;)

Cheers

connormckelvey commented 9 years ago

@pioneerskies not quite sure what you mean by "checkout a branch from inside a subdirectory?" Do you mean check out a branch when Wordpress is installed in a subdirectory?

alessandro-fazzi commented 9 years ago

Nope :)

cd wp-admin
git co other-branch

I know that isn't an usual path anyway

connormckelvey commented 9 years ago

Good point. I suppose I need to write a function to find the Movefile.

alessandro-fazzi commented 8 years ago

Removing from milestone w/o mercy. I'm sorry, but more important things are there to be fixed ;)

alessandro-fazzi commented 7 years ago

We have introduced internally the not-so-tricky-trick to use

wordpress_path: "<%= ENV['WORDPRESS_WORKS_PATH'] %>/tessile"

and so using erb interpolation and env variable convention throughout the team. It's not documented, but I feel comfortable with the "convention over implementation" approach