ejar-gitlab-pipeline-automator 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.
package/postinstall.js ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install script to show setup instructions
5
+ */
6
+
7
+ import fs from 'fs';
8
+ import path from 'path';
9
+ import { fileURLToPath } from 'url';
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+
14
+ console.log('\n' + '='.repeat(60));
15
+ console.log('✅ GitLab Pipeline Automator installed successfully!');
16
+ console.log('='.repeat(60) + '\n');
17
+
18
+ console.log('📋 Quick Setup:\n');
19
+
20
+ console.log('1. Set up SCRIPTS_PATH environment variable:');
21
+ console.log(' This is the path to your Ruby scripts directory.\n');
22
+
23
+ const platform = process.platform;
24
+ if (platform === 'darwin' || platform === 'linux') {
25
+ console.log(' macOS/Linux:');
26
+ console.log(' Add to ~/.zshrc (or ~/.bashrc):');
27
+ console.log(' export SCRIPTS_PATH="/path/to/your/scripts"');
28
+ console.log(' Then run: source ~/.zshrc\n');
29
+ } else if (platform === 'win32') {
30
+ console.log(' Windows (PowerShell):');
31
+ console.log(' [System.Environment]::SetEnvironmentVariable("SCRIPTS_PATH", "C:\\path\\to\\your\\scripts", "User")');
32
+ console.log(' Restart PowerShell after running this command.\n');
33
+ }
34
+
35
+ console.log('2. Install Playwright browsers:');
36
+ console.log(' npx playwright install chromium firefox\n');
37
+
38
+ console.log('3. Run the tool:');
39
+ console.log(' gitlab-pipeline-automator -t "ticket" -s "script" -e "service"\n');
40
+
41
+ console.log('📖 For detailed setup instructions, see:');
42
+ console.log(' - README.md (in the package directory)');
43
+ console.log(' - ENV_SETUP.md (detailed environment variable setup)\n');
44
+
45
+ // Try to show where the package is installed
46
+ try {
47
+ const packagePath = path.dirname(__dirname);
48
+ const readmePath = path.join(packagePath, 'README.md');
49
+ const envSetupPath = path.join(packagePath, 'ENV_SETUP.md');
50
+
51
+ if (fs.existsSync(readmePath) || fs.existsSync(envSetupPath)) {
52
+ console.log('📁 Package location:');
53
+ if (fs.existsSync(readmePath)) {
54
+ console.log(` README: ${readmePath}`);
55
+ }
56
+ if (fs.existsSync(envSetupPath)) {
57
+ console.log(` Setup Guide: ${envSetupPath}`);
58
+ }
59
+ console.log('');
60
+ }
61
+ } catch (err) {
62
+ // Ignore errors
63
+ }
64
+
65
+ console.log('💡 Tip: Run "gitlab-pipeline-automator --help" to see all options\n');
66
+ console.log('='.repeat(60) + '\n');