Skip to content

Commit 3d87869

Browse files
committed
BUILD: Refactor composer scripts
1 parent a540a7a commit 3d87869

File tree

5 files changed

+25
-43
lines changed

5 files changed

+25
-43
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
# Composer
88
/vendor
99

10-
# Smarty
11-
/templates/compiled
12-
1310
# CSS / SCSS
14-
/public_html/css
1511
.sass-cache/
1612
*.css.map
1713
*.sass.map

README.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,19 @@ Before installing please make sure you have the following installed:
2323
* [Glue](https://glue.readthedocs.io/en/latest/installation.html)
2424
* [Redis](https://redis.io/) (Optional)
2525

26-
### Installing
26+
### Installing & Developing
2727

2828
Clone this repo
2929

30-
```
31-
git clone https://github.com/scummvm/scummvm-web.git
32-
```
30+
git clone https://github.com/scummvm/scummvm-web.git
3331

34-
Then install the required PHP dependencies with:
32+
To run the a development version of the site and start a local web server on port 8000, run:
3533

36-
```
37-
composer install
38-
```
34+
composer develop
3935

40-
To run the build scripts and start a web server on port 8000, run:
36+
To build for production simply run:
4137

42-
```
43-
composer develop[-win]
44-
```
45-
46-
Instead of the above command, you can either build and run independently using:
47-
```
48-
composer build[-win]
49-
composer start
50-
```
51-
respectively.
38+
composer build
5239

5340
## Deployment
5441

composer.json

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,37 +33,26 @@
3333
},
3434
"scripts": {
3535
"build-common": [
36-
"glue public_html/images/icons/games/ --img=images/ --scss=scss/sprites/ --retina",
37-
"glue public_html/images/icons/platforms/ --img=images/ --scss=scss/sprites/ --retina",
38-
"mv scss/sprites/games.scss scss/sprites/_games.scss",
39-
"mv scss/sprites/platforms.scss scss/sprites/_platforms.scss",
40-
"mv images/*.png public_html/images",
41-
"rm -rf images",
42-
"composer install --no-dev",
36+
"@icons",
4337
"@scss",
44-
"@localize",
45-
"npm install --production"
38+
"@localize"
4639
],
47-
"build-win": [
48-
"if NOT EXIST public_html\\css mkdir public_html\\css",
40+
"build": [
41+
"composer install --no-dev",
4942
"@build-common",
50-
"if NOT EXIST templates\\compiled mkdir templates\\compiled"
43+
"npm install --production"
5144
],
52-
"build": [
53-
"mkdir -p public_html/css",
45+
"build-dev": [
46+
"composer install",
5447
"@build-common",
55-
"mkdir -p templates/compiled"
48+
"npm install"
5649
],
5750
"start": [
5851
"Composer\\Config::disableProcessTimeout",
5952
"php -S localhost:8000 -t ./public_html ./public_html/index.php"
6053
],
6154
"develop": [
62-
"@build",
63-
"@start"
64-
],
65-
"develop-win": [
66-
"@build-win",
55+
"@build-dev",
6756
"@start"
6857
],
6958
"lint": [
@@ -79,6 +68,12 @@
7968
],
8069
"localize": [
8170
"php include/LocalizationUtils.php"
71+
],
72+
"icons": [
73+
"glue public_html/images/icons/games/ --img=public_html/images/ --scss=scss/sprites/ --retina",
74+
"glue public_html/images/icons/platforms/ --img=public_html/images/ --scss=scss/sprites/ --retina",
75+
"mv scss/sprites/games.scss scss/sprites/_games.scss",
76+
"mv scss/sprites/platforms.scss scss/sprites/_platforms.scss"
8277
]
8378
},
8479
"autoload": {

public_html/css/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

templates/compiled/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)