0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/create-astro/test/helpers.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
493 B
JavaScript
Raw Normal View History

import { execaSync } from 'execa';
import path from 'path';
import { fileURLToPath, pathToFileURL } from 'url';
const GITHUB_SHA = process.env.GITHUB_SHA || execaSync('git', ['rev-parse', 'HEAD']).stdout; // process.env.GITHUB_SHA will be set in CI; if testing locally execa() will gather this
const FIXTURES_DIR = path.join(fileURLToPath(path.dirname(import.meta.url)), 'fixtures');
const FIXTURES_URL = pathToFileURL(FIXTURES_DIR + '/');
2021-07-07 15:10:09 -05:00
export { GITHUB_SHA, FIXTURES_DIR, FIXTURES_URL };