Skip to content

Instantly share code, notes, and snippets.

@kyonmm
Created May 16, 2011 03:48
Show Gist options
  • Save kyonmm/973901 to your computer and use it in GitHub Desktop.
Save kyonmm/973901 to your computer and use it in GitHub Desktop.
指定ディレクトリ配下のファイルの改行コードを変換する
new File("src").eachDirRecurse {
it.eachFile {
if (it.isFile()) {
def s = "${it.readLines().join("\n")}\n"
BufferedWriter w = it.newWriter("UTF-8")
w.write(s)
w.flush()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment