Skip to content

Commit 6f6eb59

Browse files
committed
release: 0.6.1
1 parent 08d05c9 commit 6f6eb59

File tree

6 files changed

+13
-19
lines changed

6 files changed

+13
-19
lines changed

docs/README_contributors.md

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Use VSCode and debug the task `Launch Standalone Program`.
154154

155155
```
156156
cd angular-cli-ghpages/src
157+
npx prettier --write '**/*'
157158
npm run build
158159
npm run test
159160
npm publish dist

src/deploy/actions.spec.ts

+6-10
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,13 @@ describe('Deploy Angular apps', () => {
7070
___?: ScheduleOptions
7171
) =>
7272
Promise.resolve({
73-
result: Promise.resolve(
74-
createBuilderOutputMock(false, 'build error test')
75-
)
73+
result: Promise.resolve(createBuilderOutputMock(false))
7674
} as BuilderRun);
7775
try {
7876
await deploy(mockEngine, context, 'host', {});
7977
fail();
8078
} catch (e) {
81-
expect(e.message).toMatch(/build error test/);
79+
expect(e.message).toEqual('Error while building the app.');
8280
}
8381
});
8482
});
@@ -112,18 +110,16 @@ const initMocks = () => {
112110
Promise.resolve({} as BuilderRun),
113111
scheduleTarget: (_: Target, __?: JsonObject, ___?: ScheduleOptions) =>
114112
Promise.resolve({
115-
result: Promise.resolve(createBuilderOutputMock(true, ''))
113+
result: Promise.resolve(createBuilderOutputMock(true))
116114
} as BuilderRun)
117115
};
118116
};
119117

120-
const createBuilderOutputMock = (
121-
success: boolean,
122-
error: string
123-
): BuilderOutput => {
118+
const createBuilderOutputMock = (success: boolean): BuilderOutput => {
124119
return {
125120
info: { info: null },
126-
error: error,
121+
// unfortunately error is undefined in case of a build errors
122+
error: (undefined as unknown) as string,
127123
success: success,
128124
target: {} as Target
129125
};

src/deploy/actions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default async function deploy(
4848
const buildResult = await build.result;
4949

5050
if (!buildResult.success) {
51-
throw new Error("Error while building the app.");
51+
throw new Error('Error while building the app.');
5252
}
5353
}
5454

src/deploy/builder.ts

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export default createBuilder<any>(
5454
options
5555
);
5656
} catch (e) {
57-
5857
context.logger.error('❌ An error occurred when trying to deploy:');
5958
context.logger.error(e.message);
6059
return { success: false };

src/engine/engine.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Schema } from '../deploy/schema';
66
import { GHPages } from '../interfaces';
77
import { defaults } from './defaults';
88

9-
109
export async function run(
1110
dir: string,
1211
options: Schema,
@@ -47,16 +46,16 @@ export function prepareOptions(origOptions: Schema, logger: logging.LoggerApi) {
4746
// monkeypatch util.debuglog to get all the extra information
4847
// see https://stackoverflow.com/a/39129886
4948
const util = require('util');
50-
let debuglog = util.debuglog;
49+
let debuglog = util.debuglog;
5150
util.debuglog = set => {
5251
if (set === 'gh-pages') {
5352
return function() {
5453
let message = util.format.apply(util, arguments);
5554
logger.info(message);
56-
}
55+
};
5756
}
5857
return debuglog(set);
59-
}
58+
};
6059
}
6160

6261
if (origOptions.noDotfiles) {
@@ -219,8 +218,7 @@ async function publishViaGhPages(
219218
// do NOT (!!) await ghPages.publish,
220219
// the promise is implemented in such a way that it always succeeds – even on errors!
221220
return new Promise((resolve, reject) => {
222-
ghPages.publish(dir, options, (error) => {
223-
221+
ghPages.publish(dir, options, error => {
224222
if (error) {
225223
return reject(error);
226224
}

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-cli-ghpages",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "Deploy your Angular app to GitHub pages directly from the Angular CLI.",
55
"main": "index.js",
66
"bin": {

0 commit comments

Comments
 (0)