This repository was archived by the owner on Aug 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-deployment-alternative.js
More file actions
84 lines (69 loc) · 2.54 KB
/
Copy pathgithub-deployment-alternative.js
File metadata and controls
84 lines (69 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env node
/**
* Alternative GitHub Deployment Script
* Bypasses git lock issues by creating a fresh repository setup
*/
import { execSync } from 'child_process';
import fs from 'fs';
import path from 'path';
const CONFIG = {
githubUsername: 'DealAppSeo',
repoName: 'hyperdag-ecosystem',
commitMessage: 'Launch HyperDAG ecosystem with comprehensive security and transparency'
};
function runCommand(command, options = {}) {
console.log(`> ${command}`);
try {
return execSync(command, {
encoding: 'utf8',
stdio: options.silent ? 'pipe' : 'inherit',
...options
});
} catch (error) {
if (!options.ignoreError) {
console.error(`Error: ${error.message}`);
}
return null;
}
}
async function main() {
console.log('=== Alternative GitHub Deployment ===');
// Remove git lock files
console.log('Clearing git locks...');
runCommand('rm -f .git/index.lock', { ignoreError: true, silent: true });
runCommand('rm -f .git/refs/heads/main.lock', { ignoreError: true, silent: true });
// Check if we can access git
const gitStatus = runCommand('git status', { ignoreError: true, silent: true });
if (!gitStatus) {
console.log('Reinitializing git repository...');
runCommand('rm -rf .git', { ignoreError: true, silent: true });
runCommand('git init');
runCommand('git branch -M main');
}
// Configure git
console.log('Configuring git...');
runCommand(`git config user.name "${CONFIG.githubUsername}"`);
runCommand(`git config user.email "${CONFIG.githubUsername}@users.noreply.github.com"`);
// Set remote
console.log('Setting remote...');
runCommand('git remote remove origin', { ignoreError: true, silent: true });
runCommand(`git remote add origin https://github.com/${CONFIG.githubUsername}/${CONFIG.repoName}.git`);
// Add files
console.log('Adding files...');
runCommand('git add .');
// Commit
console.log('Creating commit...');
runCommand(`git commit -m "${CONFIG.commitMessage}"`);
// Push
console.log('Pushing to GitHub...');
runCommand('git push -u origin main');
console.log('\n✅ Successfully deployed to GitHub!');
console.log(`Repository: https://github.com/${CONFIG.githubUsername}/${CONFIG.repoName}`);
}
main().catch(error => {
console.error('Deployment failed:', error.message);
console.log('\nAlternative options:');
console.log('1. Download project as zip and upload manually');
console.log('2. Use GitHub CLI: gh repo create and gh repo sync');
console.log('3. Clone empty repo locally and copy files');
});