[ADF-4825] Use ADF-CLI in ADF for versions and latest commit (#4994)

* [ADF-4825] Use ADF-CLI in ADF for versions and latest commit

* Add documentation

* Update update-version.ts

* Update release.sh

* Update update-project.sh

* Update release.sh

* Update update-project.sh

* Update release.sh

* Update update-project.sh

* Update README.md

* Rebase branch

* Update package.json

* Update build.sh

* Update package.json
This commit is contained in:
davidcanonieto
2019-08-28 11:01:00 +01:00
committed by Maurizio Vitale
parent 3aed425020
commit 8a48738b99
6 changed files with 34 additions and 15 deletions

View File

@@ -23,6 +23,7 @@ import { spawnSync } from 'child_process';
export interface CommitArgs {
pointer: string;
pathPackage: string;
skipGnu: boolean;
}
function _exec(command: string, args: string[], opts: { cwd?: string }, logger: logging.Logger) {
@@ -55,7 +56,11 @@ function _commitPerform(args: CommitArgs, logger: logging.Logger): string {
function _replacePerform(args: CommitArgs, sha: string, logger: logging.Logger) {
logger.info(`Replace commit ${sha} in package...`);
const sedRule = `s/\"commit\": \".*\"/\"commit\": \"${sha}\"/g`;
_exec('sed', [`-i`, `${sedRule}`, `${args.pathPackage}/package.json`], {}, logger);
if (args.skipGnu) {
_exec('sed', [`-i`, '', `${sedRule}`, `${args.pathPackage}/package.json`], {}, logger);
} else {
_exec('sed', [`-i`, `${sedRule}`, `${args.pathPackage}/package.json`], {}, logger);
}
}
export default async function (args: CommitArgs, logger: logging.Logger) {