Skip to content

Commit

Permalink
fix: trim whitespace excluding autoclean
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Jun 15, 2022
1 parent 63df9c9 commit f45ba1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mkdocsPublisher/githubInteraction/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ export async function deleteFromGithub(silent = false, settings: MkdocsPublicati
return false;
}
const allSharedFiles = GetFiles.getAllFileWithPath();
console.log(allSharedFiles)
let deletedSuccess = 0;
let deletedFailed = 0;
for (const file of filesInRepo) {
if (!allSharedFiles.includes(file.file)) {
if (!allSharedFiles.includes(file.file.trim())) {
try {
const checkingIndex = file.file.contains('index') ? await checkIndexFiles(octokit, settings, file.file):false;
if (!checkingIndex) {
Expand Down Expand Up @@ -79,7 +80,7 @@ function excludedFileFromDelete(file: string, settings: MkdocsPublicationSetting
const autoCleanExcluded = settings.autoCleanUpExcluded.split(',')
if (autoCleanExcluded.length > 0) {
for (const excludedFile of autoCleanExcluded) {
if (file.includes(excludedFile) && excludedFile.length > 0) {
if (file.trim().includes(excludedFile.trim()) && excludedFile.length > 0) {
return true;
}
}
Expand Down Expand Up @@ -107,6 +108,7 @@ export async function filterGithubFile(fileInRepo: { file: string; sha: string }
!excludedFileFromDelete(file.file, settings) &&
file.file.match(/(md|jpe?g|png|gif|bmp|svg|mp3|webm|wav|m4a|ogg|3gp|flac|mp4|ogv|pdf)$/)
) {
console.log('shared')
sharedFilesInRepo.push(file);
}
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "main.js",
"scripts": {
"dev": "node esbuild.config.mjs",
"devseed": "node esbuild.config.mjs production && copy main.js \"G:\\Mon Drive\\Seed\\.obsidian\\plugins\\obsidian-mkdocs-publisher\"",
"build": "node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"release": "standard-version"
Expand Down

0 comments on commit f45ba1b

Please sign in to comment.