Skip to content

Conversation

@christianspecht
Copy link

With this change, you can still use setpath.cmd to open a command prompt and enter Jekyll commands, like before.

Plus, you can now pass a command which will be executed.
This is useful to create batch files which you can simply double-click to execute something via Portable Jekyll:

1. Building your project with the Jekyll version from Portable Jekyll

Create a batch file in your project's folder with the following content:

"c:\PathToPortableJekyll\setpath.cmd" "jekyll serve"

Executing this batch file will use the Portable Jekyll version in the specified path to build/serve your project.

I often use batch files to run Jekyll when I need to supply additional configuration settings and I'm too lazy to type jekyll serve --foo bar --baz xyz by hand each time.

2. Executing a Ruby script using the Ruby version from Portable Jekyll

call "c:\PathToPortableJekyll\setpath.cmd" "ruby c:\foo\somescript.rb"

A batch file with this content will terminate after execution (cmd /k won't), so I can call it from another batch file.
(my use case: I have an existing batch file backing up stuff from my machine, and I needed to run wunderlist-backup from it, so my Wunderlist data is included in the backup)

Useful for automation. setpath.cmd will execute the command and
then terminate, so you can call it from another batch file.
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.

1 participant