Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Oct 14, 2012

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

@curtisblackwell

This comment has been minimized.

Copy link
Owner Author

commented Oct 17, 2012

@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
You can’t perform that action at this time.