0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/modules/manager/hermit/update.ts
Yun Lai b696abb3c2
feat: add Hermit package manager (#16258)
* feat: add Hermit package manager

* fix: pass bin directory into getRepoStatus as string rather than an array

* fix: fix up hermit manager implementations

* add docker support in exec
* move fs related operations back into  util/fs
* remove ENVVar passed on by process.env
* set concurrency in pMap
* use for instead of pMap for concurrency = 1
* use regex to pick up package reference parts

* fix: fix manager updateArtifacts test after change

* Update lib/modules/manager/hermit/extract.ts

Co-authored-by: Philip <42116482+PhilipAbed@users.noreply.github.com>

* fix: fix up test and docker reference for hermit manager

* test refer to internal fs
* docker image change to sidecar
* only symlink are read for the changed file content after hermit
  install
* no more global mock in artifacts test

* fix: use warn instead of error so error better flows up in hermit manager

* fix: partial for test type, use throw instead of reject

* fix: update snapshot

* fix: combine install packages, also make extractPackageFile async

* fix: remove weird generated readLocalSynmlink in test

* fix: removes old test

* fix: use ensureLocalPath and fix test coverage

* fix: more test coverage

* fix: use ensureLocalPath in readLocalSymlink

* Apply suggestions from code review

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* fix: remove unused functions and types

* Apply suggestions from code review

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Apply suggestions from code review

Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>

* fix: use execSnapshots and for of loop when returning the result

* Update lib/modules/manager/hermit/artifacts.spec.ts

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* fix: move exports below imports

Co-authored-by: Philip <42116482+PhilipAbed@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>
2022-07-30 08:41:45 +00:00

23 lines
694 B
TypeScript

import { logger } from '../../../logger';
import type { UpdateDependencyConfig } from '../types';
const updateLine = '#hermit updated';
/**
* updateDependency appends a comment line once.
* This is only for the purpose of triggering the artifact update
* Hermit doesn't have a package file to update like other package managers.
*/
export function updateDependency({
fileContent,
upgrade,
}: UpdateDependencyConfig): string | null {
logger.trace({ upgrade }, `hermit.updateDependency()`);
if (!fileContent.endsWith(updateLine)) {
logger.debug(`append update line to the fileContent if it hasn't been`);
return `${fileContent}\n${updateLine}`;
}
return fileContent;
}