···11-import {config} from "../config.js";
22-import {packageJson} from "../constants/index.js";
33-import {enableAutomaticSwitching} from "../functions/index.js";
11+import {config} from '../config.js';
22+import {packageJson} from '../constants/index.js';
33+import {enableAutomaticSwitching} from '../functions/index.js';
4455export async function enable({darkProfile, lightProfile}) {
66 if (!darkProfile && !config.darkProfile) {
···2121 await enableAutomaticSwitching();
22222323 console.log('Automatic switching enabled');
2424-}2424+}
+5-5
actions/index.js
···11-export {disable} from './disable.js'
22-export {enable} from './enable.js'
33-export {setModeProfile} from './set-mode-profile.js'
44-export {status} from './status.js'
55-export {updateProfile} from './update-profile.js'
11+export {disable} from './disable.js';
22+export {enable} from './enable.js';
33+export {setModeProfile} from './set-mode-profile.js';
44+export {status} from './status.js';
55+export {updateProfile} from './update-profile.js';
+2-2
actions/set-mode-profile.js
···11-import {config} from "../config.js";
11+import {config} from '../config.js';
2233export function setModeProfile({mode, profile}) {
44 config[`${mode}Profile`] = profile;
5566 console.log(`${mode} mode profile set to '${profile}'`);
77-}77+}
+3-3
actions/status.js
···11-import {isAutomaticSwitchingEnabled} from "../functions/index.js";
22-import {config} from "../config.js";
11+import {isAutomaticSwitchingEnabled} from '../functions/index.js';
22+import {config} from '../config.js';
3344-export async function status () {
44+export async function status() {
55 console.log(
66 `automatic switching : ${
77 (await isAutomaticSwitchingEnabled()) ? 'enabled' : 'disabled'
+5-5
actions/update-profile.js
···11-import {config} from "../config.js";
22-import darkMode from "dark-mode";
33-import {setTerminalProfile} from "terminal-profile";
11+import darkMode from 'dark-mode';
22+import {setTerminalProfile} from 'terminal-profile';
33+import {config} from '../config.js';
4455-export async function updateProfile () {
55+export async function updateProfile() {
66 if (!config.darkProfile) {
77 throw new Error('Dark profile not set');
88 }
···1414 const mode = (await darkMode.isEnabled()) ? 'dark' : 'light';
15151616 await setTerminalProfile(config[`${mode}Profile`]);
1717-}1717+}
+12-3
cli.js
···33import {fileURLToPath} from 'node:url';
44import {program} from 'commander';
55import {packageJson} from './constants/index.js';
66-import {disable, enable, setModeProfile, status, updateProfile} from "./actions/index.js";
66+import {
77+ disable,
88+ enable,
99+ setModeProfile,
1010+ status,
1111+ updateProfile,
1212+} from './actions/index.js';
713814program
915 .name(packageJson.name)
···1925 .action(disable);
20262127program
2222- .command('enable')
2323- .description( 'Enable automatic macOS Terminal profile switching based on system dark / light mode')
2828+ .command(
2929+ 'enable')
3030+ .description(
3131+ 'Enable automatic macOS Terminal profile switching based on system dark / light mode',
3232+ )
2433 .option(
2534 '--dark-profile <profile>',
2635 'dark profile name, for example "One Dark"',