Skip to content

Commit 6036c55

Browse files
committed
refactor(notify): define constant for notifications message
1 parent 3b76af7 commit 6036c55

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/const.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { fileURLToPath } from 'node:url';
22
import path from 'node:path';
3+
import clipboard from 'clipboardy';
34

45
// ┌ ┐
56
// │ Paths │
@@ -23,3 +24,14 @@ export const metaEndTerm = '**/';
2324
// └ ┘
2425

2526
export const MAIN_FUNCTION_EXEC = 'main(this)';
27+
28+
// ┌ ┐
29+
// │ Notifications │
30+
// └ ┘
31+
32+
export const NOTIFY = {
33+
clipboard: {
34+
title: 'Clipboard value change',
35+
subtitle: 'You have a new value in your clipboard'
36+
}
37+
};

src/scriptManager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ import fs from 'node:fs';
22
import path from 'node:path';
33
import type { Metas } from './types.js';
44
import { Script, type ScriptArguments } from './models/Script.js';
5-
import { defaultScriptPath, metaEndTerm, metaStartTerm } from './const.js';
5+
import {
6+
defaultScriptPath,
7+
metaEndTerm,
8+
metaStartTerm,
9+
NOTIFY
10+
} from './const.js';
611
import { matchesMetas, stringRange } from './utils/utils.js';
712
import { ScriptExecution } from './models/ScriptExecution.js';
813
import { Clipboard } from './utils/clipboard.js';
@@ -100,7 +105,8 @@ export class ScriptManager {
100105

101106
//TODO: Possibly change location in futur
102107
// Notify User from change
103-
FlowLauncher.showMessage('test');
108+
const { title, subtitle } = NOTIFY.clipboard;
109+
FlowLauncher.showMessage(title, subtitle);
104110
}
105111
}
106112
}

0 commit comments

Comments
 (0)