mirror of
https://gitea.com/actions/dorny-paths-filter.git
synced 2025-12-20 07:10:02 +00:00
* Export files matching rules * Improve debug output * Fix PR test workflow * Always quote output path + fix PR test * Use proper single quote escaping in workflow file * Improve error handling and docs for list-files input parameter
8 lines
347 B
TypeScript
8 lines
347 B
TypeScript
// Credits to https://github.com/xxorax/node-shell-escape
|
|
|
|
export default function shellEscape(value: string): string {
|
|
return `'${value.replace(/'/g, "'\\''")}'`
|
|
.replace(/^(?:'')+/g, '') // unduplicate single-quote at the beginning
|
|
.replace(/\\'''/g, "\\'") // remove non-escaped single-quote if there are enclosed between 2 escaped
|
|
}
|