vtasks-automate-cli 0.6.1 → 0.6.3
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/content/index.js +13 -14
- package/init.js +18 -1
- package/package.json +1 -1
package/content/index.js
CHANGED
|
@@ -103,19 +103,19 @@ async function main() {
|
|
|
103
103
|
if (branch != "qa" && branch != "dev" && branch != "master") {
|
|
104
104
|
issueNumber = Number(branch.split("_")[0]);
|
|
105
105
|
console.log(LOG_COLORS.GREEN, `Currently working on issue: ${issueNumber}`);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
const response = await fetch(`${config.vTasksUrl}`, {
|
|
107
|
+
method: "POST",
|
|
108
|
+
body: JSON.stringify({
|
|
109
|
+
projectName,
|
|
110
|
+
branch,
|
|
111
|
+
userEmail,
|
|
112
|
+
issueNumber,
|
|
113
|
+
}),
|
|
114
|
+
headers: {
|
|
115
|
+
"Content-Type": "application/json",
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
const parsed = await response.json();
|
|
119
119
|
console.log(LOG_COLORS.GREEN, "vTasks status changed successfully!");
|
|
120
120
|
} else {
|
|
121
121
|
console.log(
|
|
@@ -123,7 +123,6 @@ async function main() {
|
|
|
123
123
|
"Warning: you are working in a not issue branch"
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
|
-
console.log(userEmail, VTASKS_URL, branch, projectName);
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
main();
|
package/init.js
CHANGED
|
@@ -86,7 +86,24 @@ const main = async () => {
|
|
|
86
86
|
const postCommitContent = `#!/bin/bash
|
|
87
87
|
|
|
88
88
|
echo -e "\e[34mSwitching current branch\e[0m"
|
|
89
|
-
|
|
89
|
+
|
|
90
|
+
folders=("client" "client-nextjs" "server")
|
|
91
|
+
executed=false
|
|
92
|
+
|
|
93
|
+
for folder in "\${folders[@]}"; do
|
|
94
|
+
script_path="./$folder/node_modules/vtasks-automate-cli/content/index.js"
|
|
95
|
+
if [ -f "$script_path" ]; then
|
|
96
|
+
echo -e "\e[32mEjecutando script en $script_path\e[0m"
|
|
97
|
+
node "$script_path"
|
|
98
|
+
executed=true
|
|
99
|
+
break # Salimos del bucle después de ejecutar una vez
|
|
100
|
+
fi
|
|
101
|
+
done
|
|
102
|
+
|
|
103
|
+
if [ "$executed" = false ]; then
|
|
104
|
+
echo -e "\e[33mNo se encontró el script vTasks/index.js en ninguna carpeta\e[0m"
|
|
105
|
+
fi
|
|
106
|
+
`;
|
|
90
107
|
|
|
91
108
|
console.log(LOG_COLORS.GREEN, "Post-checkout hook added");
|
|
92
109
|
fs.writeFileSync(postCommitFile, postCommitContent);
|