Skip to content

Instantly share code, notes, and snippets.

@edmeehan
Created June 25, 2024 08:02
Show Gist options
  • Select an option

  • Save edmeehan/f4bccaab8c1d89280c48b014b5f35987 to your computer and use it in GitHub Desktop.

Select an option

Save edmeehan/f4bccaab8c1d89280c48b014b5f35987 to your computer and use it in GitHub Desktop.
Shopify Project Bash
# Ask for folder name
# echo "Enter the folder name:"
# read folder_name
# Create the folder
mkdir "$1"
# Navigate into the folder
cd "$1"
# Create shopify.theme.toml file with specified content
cat > shopify.theme.toml <<EOL
[environments.def]
store = "$2.myshopify.com"
EOL
# Create package.json file with specified content
cat > package.json <<EOL
{
"name": "$2",
"version": "1.0.0",
"description": "shopify themes",
"scripts": {
"start": "shopify theme dev -e def",
"pull-dev": "shopify theme pull -d -e def",
"pull": "shopify theme pull -e def",
"push": "shopify theme push -e def",
"test": "echo \\"Error: no test specified\\" && exit 1"
},
"author": "Ed Meehan <hello@edmeehan.dev> (https://edmeehan.dev/)"
}
EOL
# Create .shopifyignore file with specified content
cat > .shopifyignore <<EOL
_archive/*
package.json
EOL
# Create _archive folder
mkdir "_archive"
echo "Setup completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment