Skip to content

Commit

Permalink
release: 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesHoppe committed Dec 21, 2019
1 parent 08d05c9 commit 6f6eb59
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
1 change: 1 addition & 0 deletions docs/README_contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Use VSCode and debug the task `Launch Standalone Program`.

```
cd angular-cli-ghpages/src
npx prettier --write '**/*'
npm run build
npm run test
npm publish dist
Expand Down
16 changes: 6 additions & 10 deletions src/deploy/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ describe('Deploy Angular apps', () => {
___?: ScheduleOptions
) =>
Promise.resolve({
result: Promise.resolve(
createBuilderOutputMock(false, 'build error test')
)
result: Promise.resolve(createBuilderOutputMock(false))
} as BuilderRun);
try {
await deploy(mockEngine, context, 'host', {});
fail();
} catch (e) {
expect(e.message).toMatch(/build error test/);
expect(e.message).toEqual('Error while building the app.');
}
});
});
Expand Down Expand Up @@ -112,18 +110,16 @@ const initMocks = () => {
Promise.resolve({} as BuilderRun),
scheduleTarget: (_: Target, __?: JsonObject, ___?: ScheduleOptions) =>
Promise.resolve({
result: Promise.resolve(createBuilderOutputMock(true, ''))
result: Promise.resolve(createBuilderOutputMock(true))
} as BuilderRun)
};
};

const createBuilderOutputMock = (
success: boolean,
error: string
): BuilderOutput => {
const createBuilderOutputMock = (success: boolean): BuilderOutput => {
return {
info: { info: null },
error: error,
// unfortunately error is undefined in case of a build errors
error: (undefined as unknown) as string,
success: success,
target: {} as Target
};
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default async function deploy(
const buildResult = await build.result;

if (!buildResult.success) {
throw new Error("Error while building the app.");
throw new Error('Error while building the app.');
}
}

Expand Down
1 change: 0 additions & 1 deletion src/deploy/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export default createBuilder<any>(
options
);
} catch (e) {

context.logger.error('❌ An error occurred when trying to deploy:');
context.logger.error(e.message);
return { success: false };
Expand Down
10 changes: 4 additions & 6 deletions src/engine/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Schema } from '../deploy/schema';
import { GHPages } from '../interfaces';
import { defaults } from './defaults';


export async function run(
dir: string,
options: Schema,
Expand Down Expand Up @@ -47,16 +46,16 @@ export function prepareOptions(origOptions: Schema, logger: logging.LoggerApi) {
// monkeypatch util.debuglog to get all the extra information
// see https://stackoverflow.com/a/39129886
const util = require('util');
let debuglog = util.debuglog;
let debuglog = util.debuglog;
util.debuglog = set => {
if (set === 'gh-pages') {
return function() {
let message = util.format.apply(util, arguments);
logger.info(message);
}
};
}
return debuglog(set);
}
};
}

if (origOptions.noDotfiles) {
Expand Down Expand Up @@ -219,8 +218,7 @@ async function publishViaGhPages(
// do NOT (!!) await ghPages.publish,
// the promise is implemented in such a way that it always succeeds – even on errors!
return new Promise((resolve, reject) => {
ghPages.publish(dir, options, (error) => {

ghPages.publish(dir, options, error => {
if (error) {
return reject(error);
}
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-cli-ghpages",
"version": "0.6.0",
"version": "0.6.1",
"description": "Deploy your Angular app to GitHub pages directly from the Angular CLI.",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 6f6eb59

Please sign in to comment.