Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #157 without changing default behavior #190

Merged
merged 3 commits into from Oct 1, 2014
Merged

Resolves #157 without changing default behavior #190

merged 3 commits into from Oct 1, 2014

Conversation

lazypower
Copy link
Contributor

Now accepts an optional argument, eg:

$ make build doc=authors-interfaces.md
PYTHONPATH="/home/charles/workspace/juju/docs/tools/plugins:/home/charles/workspace/juju/docs/tools/plugins/gfm:" tools/build-from-source authors-interfaces.md
Converting authors-interfaces.md

I think having a single target is fine for the build action, however I'm +1 for adding a watch target, and already have phaux solution in place for that.

pip install watchdog

then follow that with

watchmedo shell-command   --patterns="*.md;"   --recursive   --command='make doc=$(basename ${watch_src_path})' .

Resolves #157

@lazypower lazypower changed the title Resolves 157 without changing default behavior Resolves #157 without changing default behavior Oct 1, 2014
@marcoceppi
Copy link
Contributor

Instead of duplicating code in the if switch, can you just make a bash method in the build-from-source file that can be used in the if statement or the for loop?

@JoshStrobl
Copy link
Contributor

Rather than having two duplicate build commands, why don't we put the argument we passed (the file) into an array (equal to f) and have an else statement (for when there is no arg) that fetches all MD files and puts it into the array.

Example code below:

if [ "$1" ]; then
  f=("src/en/$1")
else
  f=$(find src/en/ -type f -name "*.md")
fi

for file in $f; do
  build $file
done

@lazypower
Copy link
Contributor Author

Ok, cleaned up the bash file, created a tools/watch.sh to do the incremental building with 'make watch' - since there's no ubuntu package, added an echo about how to get watchdog installed if you're missing the watchmedo command.

@JoshStrobl
Copy link
Contributor

I'm not entirely familiar with the watcher command syntax that was used, but there isn't anything glaring out at me that'd be an issue, so LGTM.

@lazypower
Copy link
Contributor Author

for future people that find this: https://pypi.python.org/pypi/watchdog - look under Shell Utilities

lazypower pushed a commit that referenced this pull request Oct 1, 2014
Resolves #157 without changing default behavior
@lazypower lazypower merged commit 6803483 into juju:master Oct 1, 2014
@lazypower lazypower deleted the single_compile branch June 28, 2016 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants