Skip to content

Instantly share code, notes, and snippets.

@mkovalyk
Last active September 28, 2018 23:08
Show Gist options
  • Save mkovalyk/f47a23b999d010cc6ffe6cdd7a6e317d to your computer and use it in GitHub Desktop.
Save mkovalyk/f47a23b999d010cc6ffe6cdd7a6e317d to your computer and use it in GitHub Desktop.
Rename to Kotlin, commit and rename back to Java
# change directory to one passed as first parameter
cd $1
#rename all files to kt
for f in *.java
do
filename="${f%.*}"
echo "Processing $f file.."
git mv $f $filename.kt
done
#commit files
git commit -a -m "Convert '$1' to Kotlin. Iteration #1"
# rename back to java files
for f in *.kt
do
filename="${f%.*}"
echo "Processing $f file.."
git mv $f $filename.java
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment