Skip to content

Instantly share code, notes, and snippets.

@david-mart
Created June 13, 2019 21:14
Show Gist options
  • Save david-mart/3a3034509095856ad6eb88103ed0aa4d to your computer and use it in GitHub Desktop.
Save david-mart/3a3034509095856ad6eb88103ed0aa4d to your computer and use it in GitHub Desktop.
#!/bin/bash
rm -rf $PWD/$1
mkdir $PWD/$1
var1=$1
name=`echo -n "${var1}" | sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g' -e 's/ //g' `
echo "import React from 'react';
import './"$1".scss';
import propTypes from 'prop-types';
const "${name}" = () => {
return (
<div styleName='"$1"'>
</div>
);
};
export default "${name}";" >> $PWD/$1/index.js
echo "."$1" {
}" >> $PWD/$1/$1.scss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment