git-arweave-lfs
Version:
A Git extension for versioning large files with Arweave storage
43 lines • 2.21 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.uninstallCommand = exports.installCommand = void 0;
const simple_git_1 = __importDefault(require("simple-git"));
const installCommand = async () => {
try {
const git = (0, simple_git_1.default)();
await git.addConfig('filter.arweave-lfs.clean', 'git-arweave-lfs clean %f', false, 'global');
await git.addConfig('filter.arweave-lfs.smudge', 'git-arweave-lfs smudge %f', false, 'global');
await git.addConfig('filter.arweave-lfs.required', 'true', false, 'global');
await git.addConfig('diff.arweave-lfs.command', 'git-arweave-lfs diff', false, 'global');
console.log('✅ Git Arweave LFS filters installed globally');
console.log('🌍 All repositories will now use Arweave LFS for tracked files');
console.log('💡 Set your wallet with: git arweave-lfs config set-wallet <path>');
console.log('📝 Track files with: git arweave-lfs track "*.zip"');
}
catch (error) {
console.error('Error installing Git Arweave LFS:', error);
process.exit(1);
}
};
exports.installCommand = installCommand;
const uninstallCommand = async () => {
try {
const git = (0, simple_git_1.default)();
await git.raw(['config', '--global', '--unset', 'filter.arweave-lfs.clean']);
await git.raw(['config', '--global', '--unset', 'filter.arweave-lfs.smudge']);
await git.raw(['config', '--global', '--unset', 'filter.arweave-lfs.required']);
await git.raw(['config', '--global', '--unset', 'diff.arweave-lfs.command']);
console.log('✅ Git Arweave LFS filters uninstalled globally');
console.log('🌍 Repositories will no longer use Arweave LFS filters');
console.log('💡 Existing tracked files will remain as pointer files');
}
catch (error) {
console.error('Error uninstalling Git Arweave LFS:', error);
process.exit(1);
}
};
exports.uninstallCommand = uninstallCommand;
//# sourceMappingURL=install.js.map
;