Sha256: d521e82f698ce5b26a71c3c358570dde0a744ee9c3556847bb0f9cc7e98036ff

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

import toplevel from '@commitlint/top-level';
import fs from 'fs/promises';
import { getEditFilePath } from './get-edit-file-path.js';
// Get recently edited commit message
export async function getEditCommit(cwd, edit) {
    const top = await toplevel(cwd);
    if (typeof top !== 'string') {
        throw new TypeError(`Could not find git root from ${cwd}`);
    }
    const editFilePath = await getEditFilePath(top, edit);
    const editFile = await fs.readFile(editFilePath);
    return [`${editFile.toString('utf-8')}\n`];
}
//# sourceMappingURL=get-edit-commit.js.map

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pcp-server-ruby-sdk-0.0.6 node_modules/@commitlint/read/lib/get-edit-commit.js
pcp-server-ruby-sdk-0.1.0 node_modules/@commitlint/read/lib/get-edit-commit.js