Skip to content

Commit

Permalink
fix: delete file using full path
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Nov 28, 2024
1 parent 1bc51d5 commit ebf332c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/check-project/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ export async function ensureFileHasContents (projectDir, filePath, expectedConte
* @param {string} filePath
*/
export async function ensureFileNotPresent (projectDir, filePath) {
const fileExists = fs.existsSync(path.join(projectDir, filePath))
const fullPath = path.join(projectDir, filePath)
const fileExists = fs.existsSync(fullPath)

if (fileExists) {
if (process.env.CI) {
throw new Error(`${filePath} exists`)
}

console.warn(kleur.yellow(`${filePath} exist`))
console.warn(kleur.yellow(`${filePath} exists`))

const { removeFile } = await prompt.get({
properties: {
Expand All @@ -146,7 +147,7 @@ export async function ensureFileNotPresent (projectDir, filePath) {
throw new Error(`Not removing ${filePath} file`)
}

fs.rmSync(filePath)
fs.rmSync(fullPath)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export const usesReleasePlease = (dir = process.cwd()) => {
encoding: 'utf-8'
})

return contents.includes('uses: google-github-actions/release-please-action')
return contents.includes('release-please-action')
} catch {
return false
}
Expand Down

0 comments on commit ebf332c

Please sign in to comment.