kadai 0.8.0 → 1.0.0

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.
Files changed (2) hide show
  1. package/dist/cli.js +21 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -333,6 +333,26 @@ var init_loader = __esm(() => {
333
333
  import { join as join4 } from "path";
334
334
  async function saveLastAction(kadaiDir, actionId) {
335
335
  await Bun.write(join4(kadaiDir, LAST_ACTION_FILE), actionId);
336
+ await ensureGitignore(kadaiDir);
337
+ }
338
+ async function ensureGitignore(kadaiDir) {
339
+ const gitignorePath = join4(kadaiDir, ".gitignore");
340
+ const file = Bun.file(gitignorePath);
341
+ if (await file.exists()) {
342
+ const content = await file.text();
343
+ const lines = content.split(`
344
+ `).map((l) => l.trim());
345
+ if (!lines.includes(LAST_ACTION_FILE)) {
346
+ const suffix = content.endsWith(`
347
+ `) ? "" : `
348
+ `;
349
+ await Bun.write(gitignorePath, `${content}${suffix}${LAST_ACTION_FILE}
350
+ `);
351
+ }
352
+ } else {
353
+ await Bun.write(gitignorePath, `${LAST_ACTION_FILE}
354
+ `);
355
+ }
336
356
  }
337
357
  async function loadLastAction(kadaiDir) {
338
358
  const file = Bun.file(join4(kadaiDir, LAST_ACTION_FILE));
@@ -963,7 +983,7 @@ var init_commands = __esm(() => {
963
983
  var require_package = __commonJS((exports, module) => {
964
984
  module.exports = {
965
985
  name: "kadai",
966
- version: "0.8.0",
986
+ version: "1.0.0",
967
987
  type: "module",
968
988
  bin: {
969
989
  kadai: "./dist/cli.js"
@@ -1170,11 +1190,6 @@ echo "Add your own scripts to .kadai/actions/ to get started."
1170
1190
  `);
1171
1191
  sampleCreated = true;
1172
1192
  }
1173
- const gitignorePath = join11(kadaiDir, ".gitignore");
1174
- if (!await Bun.file(gitignorePath).exists()) {
1175
- await Bun.write(gitignorePath, `.last-action
1176
- `);
1177
- }
1178
1193
  const configContent = generateConfigFile();
1179
1194
  const configPath = join11(kadaiDir, "config.ts");
1180
1195
  await Bun.write(configPath, configContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kadai",
3
- "version": "0.8.0",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "kadai": "./dist/cli.js"