Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 3121742

Browse files
committed
bugfix: check for path was broken, more README
1 parent 6b56afb commit 3121742

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ By default, a deployment builder **shall** compile in `production` mode, but it
3030

3131
Discussion: https://github.com/angular-schule/ngx-deploy-starter/issues/1
3232

33-
### 2. A deployment builder should have an interactive prompts after the "ng add".
33+
### 2. A deployment builder should have an interactive prompt after the "ng add".
3434

3535
To make it easier for the end user to get started, a deployment builder **should** ask for all the mandatory questions immediately after the `ng add`.
3636
The data should be persisted in the `angular.json` file.

src/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
**Deploy your Angular app to the file system directly from the Angular CLI! 🚀**
44

5+
> **Warning:**
6+
> This is a sample project that helps you to implement your own deployment builder (`ng deploy`) for the Angular CLI.
7+
> The actual "deployment" is only a simple copy to another folder in the file system.
8+
>
9+
>**Learn more at
10+
> https://github.com/angular-schule/ngx-deploy-starter**
511
612
## Usage
713

@@ -38,7 +44,7 @@ Same as `ng build --configuration=XXX`.
3844
3945
#### --target-dir
4046
* __optional__
41-
* Default: `~/example-folder` (string)
47+
* Default: `/example-folder` (string)
4248
* Example:
4349
* `ng deploy` -- App is "deployed" to the example folder (if existing)
4450
* `ng deploy --target-/var/www/html` -- App is "deployed" to another folder

src/engine/engine.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import * as fse from 'fs-extra';
33

44
import { Schema } from '../deploy/schema';
55

6-
// TODO: add your deploy code here!
6+
// TODO: add your deployment code here!
77
export async function run(dir: string, options: Schema, logger: logging.LoggerApi) {
88

99
try {
1010

11-
if (!options.targetDir) {
12-
throw new Error('Please provide a target directory!');
13-
}
11+
options.targetDir = options.targetDir || '/example-folder';
1412

15-
if (await !fse.pathExists(options.targetDir)) {
13+
if (!await fse.pathExists(options.targetDir)) {
1614
throw new Error(`Target directory ${ options.targetDir } does not exist!`);
1715
}
1816

src/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ngx-deploy-starter",
33
"version": "0.0.1",
4-
"description": "Deployment from the Angular CLI to the file system",
4+
"description": "Deployment from the Angular CLI to the file system. This is a sample project that helps you to implement your own deployment builder (ng deploy) for the Angular CLI.",
55
"main": "index.js",
66
"scripts": {
77
"build": "rimraf dist && json2ts deploy/schema.json > deploy/schema.d.ts && tsc && copyfiles README.md builders.json collection.json package.json ngx-deploy-starter deploy/schema.json dist",
@@ -22,9 +22,12 @@
2222
"ng-deploy"
2323
],
2424
"author": {
25-
"name": "John Doe",
26-
"email": "[email protected]"
25+
"name": "Johannes Hoppe",
26+
"email": "[email protected]"
2727
},
28+
"contributors": [
29+
"Minko Gechev <[email protected]>"
30+
],
2831
"license": "MIT",
2932
"bugs": {
3033
"url": "https://github.com/angular-schule/ngx-deploy-starter/issues"

0 commit comments

Comments
 (0)