@snelusha/noto 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +6 -6
- package/dist/cli.mjs +6 -6
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -25,12 +25,12 @@ const os__default = /*#__PURE__*/_interopDefaultCompat(os);
|
|
|
25
25
|
const process__default = /*#__PURE__*/_interopDefaultCompat(process$1);
|
|
26
26
|
const ora__default = /*#__PURE__*/_interopDefaultCompat(ora);
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const APP_DIR = node_path.join(os__default.homedir(), "snelusha-noto");
|
|
29
29
|
let counter = 0;
|
|
30
30
|
async function openTemp() {
|
|
31
|
-
if (!node_fs.existsSync(
|
|
32
|
-
await node_fs.promises.mkdir(
|
|
33
|
-
const competitivePath = node_path.join(
|
|
31
|
+
if (!node_fs.existsSync(APP_DIR))
|
|
32
|
+
await node_fs.promises.mkdir(APP_DIR, { recursive: true });
|
|
33
|
+
const competitivePath = node_path.join(APP_DIR, `.${process__default.pid}.${counter}`);
|
|
34
34
|
counter += 1;
|
|
35
35
|
return node_fs.promises.open(competitivePath, "wx").then((fd) => ({
|
|
36
36
|
fd,
|
|
@@ -93,7 +93,7 @@ function spinner() {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
let storage = {};
|
|
96
|
-
const storagePath = node_path.resolve(
|
|
96
|
+
const storagePath = node_path.resolve(APP_DIR, "storage.json");
|
|
97
97
|
async function load(fn) {
|
|
98
98
|
try {
|
|
99
99
|
if (!Object.keys(storage).length) {
|
|
@@ -132,7 +132,7 @@ async function getStagedDiff() {
|
|
|
132
132
|
async function commit(message) {
|
|
133
133
|
try {
|
|
134
134
|
const result = await tinyexec.x("git", ["commit", "-m", message]);
|
|
135
|
-
return result.stdout.
|
|
135
|
+
return /file(s)? changed/i.test(result.stdout.toString());
|
|
136
136
|
} catch {
|
|
137
137
|
return false;
|
|
138
138
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -13,12 +13,12 @@ import { x } from 'tinyexec';
|
|
|
13
13
|
import { generateText } from 'ai';
|
|
14
14
|
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const APP_DIR = join(os.homedir(), "snelusha-noto");
|
|
17
17
|
let counter = 0;
|
|
18
18
|
async function openTemp() {
|
|
19
|
-
if (!existsSync(
|
|
20
|
-
await promises.mkdir(
|
|
21
|
-
const competitivePath = join(
|
|
19
|
+
if (!existsSync(APP_DIR))
|
|
20
|
+
await promises.mkdir(APP_DIR, { recursive: true });
|
|
21
|
+
const competitivePath = join(APP_DIR, `.${process$1.pid}.${counter}`);
|
|
22
22
|
counter += 1;
|
|
23
23
|
return promises.open(competitivePath, "wx").then((fd) => ({
|
|
24
24
|
fd,
|
|
@@ -81,7 +81,7 @@ function spinner() {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
let storage = {};
|
|
84
|
-
const storagePath = resolve(
|
|
84
|
+
const storagePath = resolve(APP_DIR, "storage.json");
|
|
85
85
|
async function load(fn) {
|
|
86
86
|
try {
|
|
87
87
|
if (!Object.keys(storage).length) {
|
|
@@ -120,7 +120,7 @@ async function getStagedDiff() {
|
|
|
120
120
|
async function commit(message) {
|
|
121
121
|
try {
|
|
122
122
|
const result = await x("git", ["commit", "-m", message]);
|
|
123
|
-
return result.stdout.
|
|
123
|
+
return /file(s)? changed/i.test(result.stdout.toString());
|
|
124
124
|
} catch {
|
|
125
125
|
return false;
|
|
126
126
|
}
|