Skip to content

Instantly share code, notes, and snippets.

@curtisblackwell
Created October 14, 2012 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save curtisblackwell/3888087 to your computer and use it in GitHub Desktop.
Save curtisblackwell/3888087 to your computer and use it in GitHub Desktop.
Statamic setup script

NOTICE

Discontinued in favor of Statamechanic.

Legacy Info

This script will:

  1. Remove the following files/directories:

    • _config/fieldsets/* (everything in dir)

    • _config/settings.yaml.sample

    • _config/users/admin.yaml.sample

    • _content/* (everything in dir)

    • _themes/london-wild

    • assets/img

    • check.php

    • sample.htaccess
      NOTE
      I remove this because I use the H5BP .htaccess and add the Statamic stuff to it. If you don't use another .htaccess, remove sample.htaccess from line 2. You can fork this script and add

      mv sample.htaccess .htaccess
      

      to line 3 if you want to use the default Statamic .htaccess.

  2. Collect your information to create an admin account, complete with boilerplate bio.

  3. Set your _content and _config/users dirs to 777. I'm not yet sure that's best practice, but I can't find it in the docs/forums, and I couldn't get it to work otherwise.

#! /bin/bash
rm -r _config/fieldsets/* _config/settings.yaml.sample _config/users/admin.yaml.sample _content/* _themes/london-wild assets/img check.php sample.htaccess
echo "What's your username?"
read -e USERNAME
echo "What's your password?"
read -e PASSWORD
echo "What's your first name?"
read -e FIRSTNAME
echo "What's your last name?"
read -e LASTNAME
echo "What's your email address?"
read -e EMAIL
echo "Are you a him, her, it, or perhaps something else?"
read -e GENDERID
echo "_site_name:"
read -e SITENAME
echo "---
first_name: $FIRSTNAME
last_name: $LASTNAME
roles: [admin]
password: $PASSWORD
---
$FIRSTNAME $LASTNAME is the developer of $SITENAME. If you experience any problems or have any questions, please contact $GENDERID at $EMAIL." > _config/users/$USERNAME.yaml
chmod -R 777 _content _config/users
@jackmcdade
Copy link

I'd recommend renaming "sample.htaccess" to ".htaccess" rather than removing it.

@curtisblackwell
Copy link
Author

@jackmcdade, ah, right. i use the H5BP .htaccess and add the statamic stuff to it. i'll make a note of that in the readme. thanks for pointing that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment