Skip to content

Commit ccfbf8d

Browse files
committed
fix:
- ts bug - Edit some string
1 parent db813d4 commit ccfbf8d

2 files changed

Lines changed: 13 additions & 16 deletions

File tree

src/components/InteractiveInstaller.vue

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import {
1313
kanataConfig
1414
} from '@/data/installer';
1515
16-
const selectedDistro = ref(distros[0].name);
17-
const selectedMethod = ref(methods[0]);
18-
const selectedShell = ref(shells[0]);
19-
const selectedDe = ref(deWms[0]);
20-
const selectedEnv = ref(environments[1]);
16+
const selectedDistro = ref(distros[0]?.name || '');
17+
const selectedMethod = ref<string>(methods[0] || '');
18+
const selectedShell = ref<string>(shells[0] || '');
19+
const selectedDe = ref<string>(deWms[0] || '');
20+
const selectedEnv = ref<string>(environments[1] || '');
2121
2222
const activateServerCode = computed(() => {
2323
if (selectedDistro.value === 'NixOS') return '# Bước này đã được cấu hình trong flake.nix ở trên.';
@@ -29,9 +29,6 @@ const activateServerCode = computed(() => {
2929
3030
const shellConfigCode = computed(() => {
3131
if (selectedDistro.value === 'NixOS') return '# Bước này đã được cấu hình trong flake.nix ở trên.';
32-
if (isAutoHandled.value) {
33-
return '# Gói .deb sẽ tự động thiết lập biến môi trường.\n' + envCmd.value;
34-
}
3532
return envCmd.value;
3633
});
3734
@@ -79,9 +76,9 @@ const envCmd = computed(() => {
7976
} else {
8077
// Fish
8178
const fishVars = vars.map(v => {
82-
const parts = v.split('=');
83-
const name = parts[0].replace('export ', '');
84-
const val = parts[1];
79+
const idxEq = v.indexOf('=');
80+
const name = v.slice(0, idxEq).replace('export ', '');
81+
const val = v.slice(idxEq + 1);
8582
return ` set -Ux ${name} ${val}`;
8683
});
8784
return `echo 'if status is-login\n${fishVars.join('\n')}\nend' >> ~/.config/fish/config.fish`;

src/data/installer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export const logic = {
1616
"steps": {
1717
"install": {
1818
"Arch Linux": {
19-
"Package Manager": "yay -S fcitx5-lotus",
20-
"Binary": "sudo pacman -U fcitx5-lotus-*.pkg.tar.zst",
21-
"Source": "git clone https://github.com/LotusInputMethod/fcitx5-lotus.git\ncd fcitx5-lotus\ncmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib .\nmake\nsudo make install"
19+
"Package Manager": "yay -S fcitx5-lotus-bin",
20+
"Binary": "Arch khuyến khích sử dụng AUR để cài đặt",
21+
"Source": "yay -S fcitx5-lotus-git"
2222
},
2323
"Debian": {
2424
"Package Manager": "CODENAME=$(grep '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)\nsudo mkdir -p /etc/apt/keyrings\ncurl -fsSL https://fcitx5-lotus.pages.dev/pubkey.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/fcitx5-lotus.gpg\necho \"deb [signed-by=/etc/apt/keyrings/fcitx5-lotus.gpg] https://fcitx5-lotus.pages.dev/apt/$CODENAME $CODENAME main\" | sudo tee /etc/apt/sources.list.d/fcitx5-lotus.list\nsudo apt update && sudo apt install fcitx5-lotus",
@@ -42,8 +42,8 @@ export const logic = {
4242
},
4343
"NixOS": {
4444
"Package Manager": "inputs.fcitx5-lotus = {\n url = \"github:LotusInputMethod/fcitx5-lotus\";\n inputs.nixpkgs.follows = \"nixpkgs\";\n};\n\n# In configuration.nix:\nservices.fcitx5-lotus = {\n enable = true;\n user = \"your_username\";\n};",
45-
"Binary": "NixOS prefers flake/module configuration.",
46-
"Source": "NixOS prefers nix-shell or custom derivations."
45+
"Binary": "NixOS ưu tiên cấu hình thông qua flake hoặc module.",
46+
"Source": "NixOS ưu tiên sử dụng nix-shell."
4747
}
4848
},
4949
"server": {

0 commit comments

Comments
 (0)