Skip to content

Commit

Permalink
fix(backup): fix where to find the alacritty file path (#178)
Browse files Browse the repository at this point in the history
fix #172
  • Loading branch information
JuanVqz committed Aug 21, 2022
1 parent 16c7772 commit 355e189
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ function createBackup() {
return;
}

const backupFile = `${pathToAlacrittyFile()}alacritty.yml.${Date.now()}.bak`;
const alacrittyFile = alacrittyConfigPath();
const backupFile = `${alacrittyFile}.${Date.now()}.bak`;

fsPromises
.copyFile(alacrittyFile(), backupFile)
.copyFile(alacrittyFile, backupFile)
.then(() => {
console.log(`Automatic backup file was created: ${backupFile}`);
})
Expand Down Expand Up @@ -54,10 +55,6 @@ function archHome() {
return process.env.XDG_CONFIG_HOME;
}

function alacrittyFile() {
return `${pathToAlacrittyFile()}alacritty.yml`;
}

function pathToAlacrittyFile() {
return isWindows()
? pathToAlacrittyFileOnWindows()
Expand Down

0 comments on commit 355e189

Please sign in to comment.