-
Notifications
You must be signed in to change notification settings - Fork 0
/
retinens-admin-scaffolding
executable file
·75 lines (60 loc) · 2.54 KB
/
retinens-admin-scaffolding
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash -i
RETINENS_SCRIPTS_FOLDER=$(cd $(dirname $0) && pwd)
projectname=pwd
#$RETINENS_SCRIPTS_FOLDER/check-updates
echo -e "\e[33m
_____ ______ _______ _____ _ _ ______ _ _ _____
| __ \| ____|__ __|_ _| \ | | ____| \ | |/ ____|
| |__) | |__ | | | | | \| | |__ | \| | (___
| _ /| __| | | | | | . \` | __| | . \` |\___ \\
| | \ \| |____ | | _| |_| |\ | |____| |\ |____) |
|_| \_\______| |_| |_____|_| \_|______|_| \_|_____/
\e[0m"
touch database/database.sqlite
sed -i "s+mysql+sqlite+g" .env
sed -i "s+DB_PORT=3306++g" .env
sed -i "s+DB_DATABASE=laravel++g" .env
sed -i "s+DB_USERNAME=root++g" .env
sed -i "s+DB_PASSWORD=++g" .env
git clone --depth=1 git://github.com/retinens/laravel-admin-boilerplate temp --quiet && rm temp/.git -rf
echo -e "\nAuth::routes(); \n
include 'admin.php';" >> routes/web.php
rsync -a temp/resources/ resources/ --update
rsync -a temp/app app/ --update
rsync -a temp/database/ database/ --update
rsync -a temp/routes/ routes/ --update
rsync -a temp/public/ public/ --update
rm temp -rf
sed '63i "is_admin" => \\\App\\\Http\\\Middleware\\\IsAdmin::class,' app/Http/Kernel.php > app/Http/Kernel2.php
mv app/Http/Kernel2.php app/Http/Kernel.php
source $RETINENS_SCRIPTS_FOLDER/retinens-create-admin-account
composer require yoeunes/toastr --quiet
echo -e "Editing\e[32m webpack.mix.js\e[0m to work with our boilerplate and setting up \e[32mbrowser-sync\e[0m"
echo "
const mix = require('laravel-mix');
require('laravel-mix-merge-manifest');
const domain = '$projectname.test';
const homedir = require('os').homedir();
mix.browserSync({
proxy: 'https://' + domain,
host: domain,
open: 'external',
https: {
key: homedir + '/.valet/Certificates/' + domain + '.key',
cert: homedir + '/.valet/Certificates/' + domain + '.crt',
},
});
if (['admin'].includes(process.env.npm_config_section)) {
mix.js('resources/admin/js/admin.js', 'public/backend/js')
.extract().mergeManifest();
mix.sass('resources/admin/sass/admin.scss', 'public/backend/css');
} else {
mix.js('resources/app/js/app.js', 'public/app/js')
.extract().mergeManifest().version();
mix.sass('resources/app/sass/app.scss', 'public/app/css').version();
}" >webpack.mix.js
npm install @coreui/coreui sweetalert jquery-validation select2 @ttskch/select2-bootstrap4-theme datatables.net datatables.net-bs4 toastr @fortawesome/fontawesome-pro perfect-scrollbar @popperjs/core --save
npm run dev --section=admin --silent
git add .
git commit -m "Added admin scaffolding"
git push