Skip to content

Instantly share code, notes, and snippets.

@david-mart
Created October 4, 2019 23:32
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 david-mart/24bac98aa0de0c698e3e044faeaf9fc6 to your computer and use it in GitHub Desktop.
Save david-mart/24bac98aa0de0c698e3e044faeaf9fc6 to your computer and use it in GitHub Desktop.
vue template create
#!/bin/bash
# brew install gnu-sed
var1=$1
name=`echo -n "${var1}" | gsed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g' -e 's/ //g' `
rm -rf $PWD/$name.vue
rm -rf $PWD/$name.scss
echo '<template>
<div class="'$1'">
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
@import "./'${name}'.scss";
</style>
' >> $PWD/$name.vue
echo '.'$1' {
}' >> $PWD/$name.scss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment