vtasks-automate-cli 0.9.9 → 0.10.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/init.js +17 -0
  2. package/package.json +1 -1
package/init.js CHANGED
@@ -115,7 +115,24 @@ function patchDevScript(folderPath, folderName) {
115
115
  console.log(LOG_COLORS.GREEN, `${folderName}: "dev" script patched`);
116
116
  }
117
117
 
118
+ function selfUpdate() {
119
+ const installed = getInstalledVersion(process.cwd());
120
+ if (!installed) return;
121
+
122
+ const latest = getLatestVersion(process.cwd());
123
+ if (!latest || installed === latest) return;
124
+
125
+ console.log(LOG_COLORS.BLUE, `Updating ${VTASKS_PKG} in root (${installed} → ${latest})...`);
126
+ execSync(`npm install ${VTASKS_PKG}@latest`, { cwd: process.cwd(), stdio: "inherit" });
127
+ console.log(LOG_COLORS.GREEN, `Root updated. Re-running with ${VTASKS_PKG}@${latest}...\n`);
128
+
129
+ execSync(`node node_modules/${VTASKS_PKG}/init.js`, { cwd: process.cwd(), stdio: "inherit" });
130
+ process.exit(0);
131
+ }
132
+
118
133
  const main = async () => {
134
+ selfUpdate();
135
+
119
136
  console.log(LOG_COLORS.BLUE, "Setting up vtasks-automate-cli...\n");
120
137
 
121
138
  const existingFolders = FOLDERS.filter((folder) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vtasks-automate-cli",
3
- "version": "0.9.9",
3
+ "version": "0.10.0",
4
4
  "description": "Automate your vTasks workflow with ease — move tasks between states without opening the app",
5
5
  "bin": {
6
6
  "vtasks-automate": "init.js"