Skip to content

Instantly share code, notes, and snippets.

@bitnenfer
Created February 11, 2016 14:35
Show Gist options
  • Save bitnenfer/7f62fa835fb8d757b9a2 to your computer and use it in GitHub Desktop.
Save bitnenfer/7f62fa835fb8d757b9a2 to your computer and use it in GitHub Desktop.
Jekyll setup script wirtten in pyhton.
# Jekyll setup for windows
# it just follows the instructions
# from this website: http://jekyll-windows.juthilo.com/
# If you prefer doing it manually, just visit
# the previous website.
#
# author: Felipe Alfonso
# url: http://voidptr.io/
import urllib
import os
import shutil
def make_dir(path):
if not os.path.exists(path):
os.makedirs(path)
def install_app(download_url, path, save_file, exe_args):
print "Downloading: ", download_url
full_path = path + save_file
file = urllib.urlopen(download_url)
make_dir(path)
output = open(full_path, "wb")
output.write(file.read())
output.close()
print "Saved at: ", full_path
print "Executing"
status = os.system('"' + full_path + " " + exe_args + '"')
if status:
print "Failed installation"
return False
return True
ruby_bin_path = "C:\\Ruby22\\bin\\"
ruby_devkit_path = "C:\\RubyDevKit\\"
save_path = os.getcwd() + "/temp/"
if install_app("http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.2.4.exe", save_path, "ruby_installer.exe", ""):
make_dir("C:\\RubyDevKit\\")
if install_app("http://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe", ruby_devkit_path, "ruby_devkit.exe", '-y -gm2 -InstallPath="'+ ruby_devkit_path +'"'):
os.chdir(ruby_devkit_path)
os.system('"' + ruby_bin_path + 'ruby ' + ruby_devkit_path + 'dk.rb init"')
os.system('"' + ruby_bin_path + 'ruby ' + ruby_devkit_path + 'dk.rb install"')
os.system('"' + ruby_bin_path + 'gem install jekyll"')
os.system('"' + ruby_bin_path + 'gem install rouge"')
os.system('"' + ruby_bin_path + 'gem install wdm"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment