ultimate-jekyll-manager 0.0.129 → 0.0.130
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.js +0 -1
- package/package.json +1 -1
- package/dist/commands/repo.js +0 -41
package/dist/cli.js
CHANGED
package/package.json
CHANGED
package/dist/commands/repo.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
const Manager = new (require('../build.js'));
|
|
3
|
-
const logger = Manager.logger('repo');
|
|
4
|
-
const { execute } = require('node-powertools');
|
|
5
|
-
|
|
6
|
-
module.exports = async function () {
|
|
7
|
-
// Log
|
|
8
|
-
logger.log(`Opening GitHub repository...`);
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
// Get the remote URL
|
|
12
|
-
const result = await execute('git remote get-url origin', { log: false });
|
|
13
|
-
let url = result.stdout.trim();
|
|
14
|
-
|
|
15
|
-
if (!url) {
|
|
16
|
-
throw new Error('No git remote origin found');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Convert SSH URL to HTTPS URL if needed
|
|
20
|
-
// git@github.com:user/repo.git -> https://github.com/user/repo
|
|
21
|
-
if (url.startsWith('git@')) {
|
|
22
|
-
url = url
|
|
23
|
-
.replace('git@', 'https://')
|
|
24
|
-
.replace(':', '/')
|
|
25
|
-
.replace(/\.git$/, '');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Remove .git suffix if present
|
|
29
|
-
url = url.replace(/\.git$/, '');
|
|
30
|
-
|
|
31
|
-
logger.log(`Repository URL: ${url}`);
|
|
32
|
-
|
|
33
|
-
// Open the URL in the default browser
|
|
34
|
-
await execute(`open "${url}"`, { log: false });
|
|
35
|
-
|
|
36
|
-
logger.log(logger.format.green('✓ Opened repository in browser'));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
logger.error('Failed to open repository:', e.message);
|
|
39
|
-
throw e;
|
|
40
|
-
}
|
|
41
|
-
};
|