mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(yarn): offline integrity hash (#5449)
This commit is contained in:
parent
0eb616f876
commit
5d454ca3ff
4 changed files with 13 additions and 9 deletions
|
@ -297,7 +297,7 @@ interface ArtifactError {
|
||||||
|
|
||||||
interface UpdatedArtifcats {
|
interface UpdatedArtifcats {
|
||||||
name: string;
|
name: string;
|
||||||
contents: string;
|
contents: string | Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WriteExistingFilesResult {
|
export interface WriteExistingFilesResult {
|
||||||
|
@ -480,7 +480,7 @@ export async function getAdditionalFiles(
|
||||||
const localModified = upath.join(config.localDir, f);
|
const localModified = upath.join(config.localDir, f);
|
||||||
updatedArtifacts.push({
|
updatedArtifacts.push({
|
||||||
name: f,
|
name: f,
|
||||||
contents: await fs.readFile(localModified, 'utf-8'),
|
contents: await fs.readFile(localModified),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { CommitFilesConfig } from './git/storage';
|
||||||
|
|
||||||
export interface FileData {
|
export interface FileData {
|
||||||
name: string;
|
name: string;
|
||||||
contents: string;
|
contents: string | Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GotApiOptions {
|
export interface GotApiOptions {
|
||||||
|
|
|
@ -31,7 +31,7 @@ export interface File {
|
||||||
/**
|
/**
|
||||||
* file contents
|
* file contents
|
||||||
*/
|
*/
|
||||||
contents: string;
|
contents: string | Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface StorageConfig {
|
interface StorageConfig {
|
||||||
|
@ -504,10 +504,14 @@ export class Storage {
|
||||||
await this._git.add(file.name);
|
await this._git.add(file.name);
|
||||||
} else {
|
} else {
|
||||||
fileNames.push(file.name);
|
fileNames.push(file.name);
|
||||||
await fs.outputFile(
|
let contents;
|
||||||
join(this._cwd, file.name),
|
// istanbul ignore else
|
||||||
Buffer.from(file.contents)
|
if (typeof file.contents === 'string') {
|
||||||
);
|
contents = Buffer.from(file.contents);
|
||||||
|
} else {
|
||||||
|
contents = file.contents;
|
||||||
|
}
|
||||||
|
await fs.outputFile(join(this._cwd, file.name), contents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// istanbul ignore if
|
// istanbul ignore if
|
||||||
|
|
|
@ -20,7 +20,7 @@ export async function commitFilesToBranch(
|
||||||
// istanbul ignore if
|
// istanbul ignore if
|
||||||
if (is.nonEmptyArray(config.excludeCommitPaths)) {
|
if (is.nonEmptyArray(config.excludeCommitPaths)) {
|
||||||
updatedFiles = updatedFiles.filter(f => {
|
updatedFiles = updatedFiles.filter(f => {
|
||||||
const filename = f.name === '|delete|' ? f.contents : f.name;
|
const filename = f.name === '|delete|' ? f.contents.toString() : f.name;
|
||||||
const matchesExcludePaths = config.excludeCommitPaths.some(path =>
|
const matchesExcludePaths = config.excludeCommitPaths.some(path =>
|
||||||
minimatch(filename, path, { dot: true })
|
minimatch(filename, path, { dot: true })
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue