Skip to content

Commit b36e128

Browse files
committed
Merge pull request #23 from loadsys/seed-shell
Seed shell
2 parents 813510e + e8fd1f4 commit b36e128

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"db-loadschema",
2929
"db-login",
3030
"db-sample-data",
31+
"db-seed",
3132
"db-showupdates",
3233
"db-writeconfig",
3334
"deps-install",
@@ -51,6 +52,7 @@
5152
"run-codesniffer",
5253
"run-in-vagrant",
5354
"run-tests",
55+
"semver-get-pointrelease",
5456
"set-configs",
5557
"set-owner",
5658
"symlink-cake-core",

db-seed

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
#---------------------------------------------------------------------
4+
usage ()
5+
{
6+
cat <<EOT
7+
8+
${0##*/}
9+
Convenience wrapper for running the database seed shell. The default seed file
10+
will always run, and if the --dev flag is given, then the dev seed file will
11+
also run. These files need to contain queries that won't duplicate records, and
12+
should only be used to guarantee that required data exists in the database.
13+
14+
Usage:
15+
bin/${0##*/} [--dev]
16+
17+
18+
EOT
19+
20+
exit 0
21+
}
22+
if [ "$1" = '-h' ]; then
23+
usage
24+
fi
25+
26+
27+
DIR="$( cd -P "$( dirname "$0" )"/.. >/dev/null 2>&1 && pwd )"
28+
29+
$DIR/Console/cake BasicSeed.basic_seed seed
30+
if [ "$1" = '--dev' ]; then
31+
$DIR/Console/cake BasicSeed.basic_seed seed --dev
32+
fi
33+

0 commit comments

Comments
 (0)