Skip to content

Instantly share code, notes, and snippets.

@wolfwood
Forked from brianmadden/update.hs
Created January 29, 2011 04:05
Show Gist options
  • Save wolfwood/801509 to your computer and use it in GitHub Desktop.
Save wolfwood/801509 to your computer and use it in GitHub Desktop.
import System.Directory
import System.IO
import IO
import GHC.IO.Handle
import System.Process
import Text.Printf
main = do
-- Change directory to the mc_mapping dir
setCurrentDirectory "/home/untwisted/projects/mc_mapping/"
-- Run the rsync process
-- rsync -irz [email protected]:minecraft/minecraft_b/bin/world/ world/ | tee chunks2.out
rsync_out <- readProcess "rsync" ["-rvz",
"/home/cooleo/minecraft/minecraft_beta/world",
"/home/untwisted/projects/mc_mapping/"] []
-- Write chunks to file so only they are updated
let rsync_out' = lines rsync_out
writeFile "chunks.out" $ clean rsync_out'
-- call pigmap
pigmap_out <- readProcess "/home/untwisted/projects/minecraft/pigmap/pigmap"
["-i", "/home/untwisted/projects/mc_mapping/world/",
"-o", "/home/untwisted/projects/mc_mapping/tiles/",
"-g", "/home/untwisted/projects/mc_mapping/",
"-c", "/home/untwisted/projects/mc_mapping/chunks.out",
"-h", "3", "-x"] []
printf "MAP UPDATED"
where clean =
unlines . tail . init . init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment