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

Support dot-notation for changelog option #461

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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 bin/cmds/app/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.builder = yargs => {
.option('changelog', {
default: null,
type: 'string',
description: 'What\'s new in this version?',
description: 'What\'s new in this version? Use dot-notation for translation. Example: --changelog.en "Add new feature" --changelog.de "Neue Funktionalität"',
})
.option('commit', {
description: 'Create a git commit and tag for the new version',
Expand Down
12 changes: 10 additions & 2 deletions lib/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,12 @@ $ sudo systemctl restart docker
const { version } = manifest;

changelogJson[version] = changelogJson[version] || {};
changelogJson[version]['en'] = text;

if (typeof text !== "string") {
changelogJson[version] = text;
} else {
changelogJson[version]['en'] = text;
}

await fse.writeJson(changelogJsonPath, changelogJson, {
spaces: 2,
Expand All @@ -1096,7 +1101,10 @@ $ sudo systemctl restart docker
if (hasChangelog) {
commitFiles.push(path.join(this.path, '.homeychangelog.json'));

changelog = { en: changelog };
if (typeof changelog === "string") {
changelog = { en: changelog };
}

} else {
// Retrieve from changelog file
const changelogJsonPath = path.join(this.path, '.homeychangelog.json');
Expand Down