@@ -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
2222const 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
3030const 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 ' )}\n end' >> ~/.config/fish/config.fish ` ;
0 commit comments