Skip to content

Instantly share code, notes, and snippets.

@joshbooks
Last active March 29, 2021 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshbooks/9a1e33a5e8e82874150b0074959271ef to your computer and use it in GitHub Desktop.
Save joshbooks/9a1e33a5e8e82874150b0074959271ef to your computer and use it in GitHub Desktop.
create new kotlin file corresponding to existing java path
#!/bin/bash
javaPath=$1
kotlinPath=`echo "$javaPath" | sed 's|/java/|/kotlin/|' | sed 's|\.java|.kt|'`
echo "creating $kotlinPath"
parentDir=`echo "$kotlinPath" | sed 's|[^/]*$||'`
mkdir -p $parentDir
touch $kotlinPath
#!/bin/bash
javaPath=$1
kotlinPath=`echo "$javaPath" | sed 's|/java/|/kotlin/|' | sed 's|\.java|.kt|'`
echo "creating $kotlinPath"
parentDir=`echo "$kotlinPath" | sed 's|[^/]*$||'`
mkdir -p $parentDir
mv $javaPath $kotlinPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment