Skip to content

Commit

Permalink
chore: fix multiple config overwrite by removing preview function
Browse files Browse the repository at this point in the history
  • Loading branch information
rajasegar committed Apr 9, 2024
1 parent a76822d commit 3485250
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 40 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ jobs:
run: |
yarn test
build-and-deploy:
name: Publish
needs: [lint]
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Volta setup
uses: rwjblue/setup-volta@v1
- name: Install
run: yarn install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
# build-and-deploy:
# name: Publish
# needs: [lint]
# runs-on: ubuntu-latest
# if: "!contains(github.event.head_commit.message, 'skip ci')"
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Volta setup
# uses: rwjblue/setup-volta@v1
# - name: Install
# run: yarn install
# - name: Release
# env:
# GITHUB_TOKEN: ${{ secrets.GH_PAT }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: yarn semantic-release
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/pre-commit

This file was deleted.

18 changes: 11 additions & 7 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
createBackup,
helpMessage,
existingTheme,
themesFolder,
themesFolder
} = require('../src/helpers');

const { applyTheme, createConfigFile, getCurrentTheme } = require('../index');
Expand All @@ -19,12 +19,12 @@ let themes = fs
.map((f) => f.replace('.toml', ''));

function main() {
createBackup();
// createBackup();
const command = process.argv[2];

if (existingTheme(command, themesFolderPath)) {
return applyTheme(command, themesFolderPath);
}
// if (existingTheme(command, themesFolderPath)) {
// return applyTheme(command, themesFolderPath);
// }

if (['--directory', '-d'].includes(command)) {
if (process.argv[3] === undefined) {
Expand Down Expand Up @@ -63,16 +63,20 @@ function main() {
choices: themes.map((t) => {
return {
title: t,
value: t,
value: t
};
}),
onState: (state) => {
state.value && applyTheme(state.value, themesFolderPath, true); // set preview true
// state.value && applyTheme(state.value, themesFolderPath, true); // set preview true
},
onCancel: (state) => {
// revert to backup
}
});

try {
if (response.theme) {
createBackup();
applyTheme(response.theme, themesFolderPath);
}
} catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
alacrittyFileExists,
alacrittyTemplatePath,
pathToAlacrittyFile,
themeFilePath,
themeFilePath
} = require('./src/helpers');
const { exit } = require('process');

Expand Down Expand Up @@ -122,5 +122,5 @@ module.exports = {
applyTheme,
createConfigFile,
getAlacrittyConfig,
getCurrentTheme,
getCurrentTheme
};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alacritty-themes",
"version": "6.0.0",
"version": "6.0.1",
"description": "Themes for Alacritty : A cross-platform GPU-Accelerated Terminal emulator",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 3485250

Please sign in to comment.