MCPcopy Index your code
hub / github.com/github/docs / getFilepath

Function getFilepath

tests/content/site-data-references.js:120–130  ·  view source on GitHub ↗
(filepath)

Source from the content-addressed store, hash-verified

118
119// if path exists, assume it's a directory; otherwise, assume a YML extension
120async function getFilepath(filepath) {
121 try {
122 await fs.stat(filepath)
123 filepath = filepath + '/'
124 } catch (_) {
125 filepath = filepath + '.yml'
126 }
127
128 // we only need the relative path
129 return filepath.replace(path.join(__dirname, '../../'), '')
130}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected