Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/stability #21

Merged
merged 12 commits into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Expo - Semantic Release

[![Latest Release](https://img.shields.io/github/release/byCedric/semantic-release-expo/all.svg?style=flat-square)](https://github.com/byCedric/semantic-release-expo/releases)
[![Build Status](https://img.shields.io/travis/byCedric/semantic-release-expo/master.svg?style=flat-square)](https://travis-ci.com/byCedric/semantic-release-expo)
[![Build Status](https://img.shields.io/travis/com/byCedric/semantic-release-expo/master.svg?style=flat-square)](https://travis-ci.com/byCedric/semantic-release-expo)
[![Codecov coverage](https://img.shields.io/codecov/c/github/byCedric/semantic-release-expo.svg?style=flat-square)](https://codecov.io/gh/byCedric/semantic-release-expo)
[![Code Climate grade](https://img.shields.io/codeclimate/maintainability/byCedric/semantic-release-expo.svg?style=flat-square)](https://codeclimate.com/github/byCedric/semantic-release-expo)

Expand Down
16 changes: 14 additions & 2 deletions src/scripts/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { readManifests, writeManifest } from '../expo';
import { SemanticMethod } from '../types';
import bumpVersions from '../version-bumpers';

const SemanticReleaseError = require('@semantic-release/error');

/**
* Prepare the new release by updating the manifest.
* Prepare the new release by updating all manifests.
* This should update at least the `version` using the next release version name.
* It should also update the version code and build number when available.
*/
Expand All @@ -21,7 +23,17 @@ const prepare: SemanticMethod = async (config, context) => {
})
));

await Promise.all(writes);
try {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

await Promise.all(writes);
} catch (error) {
if (error.expo) {
context.logger.log('Error encountered for %s manifest %s', 'Expo', error.expo);
}

throw new SemanticReleaseError('Could not write Expo manifest(s)', 'EWRITEEXPOMANIFEST', error.message);
}

context.logger.log('Updated all %s manifests!', writes.length);
};

export default prepare;
2 changes: 1 addition & 1 deletion src/scripts/verify-conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const SemanticReleaseError = require('@semantic-release/error');

/**
* Verify the configuration of this plugin.
* This checks if an Expo `app.json` can be found.
* This checks if all Expo manifests are readable.
*/
const verifyConditions: SemanticMethod = async (config, context) => {
const verifyConfig = inheritPrepareConfig(config, context);
Expand Down