mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Update try catch blocks to revert changes on error
A failure to set the git tag returns and undoes the changes done previously
This commit is contained in:
parent
6e6e52fd8c
commit
f74da6e0fc
1 changed files with 6 additions and 0 deletions
|
@ -117,6 +117,7 @@ task('pack-webext', 'pack the webextension for deployment', function() {
|
||||||
execSync(`rm -f source.zip`);
|
execSync(`rm -f source.zip`);
|
||||||
execSync(`rm -f webext/webext.zip`);
|
execSync(`rm -f webext/webext.zip`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
//Usually this happens because the zip files were removed previously
|
||||||
console.log('Error removing zip files');
|
console.log('Error removing zip files');
|
||||||
}
|
}
|
||||||
execSync(`git submodule update --remote`);
|
execSync(`git submodule update --remote`);
|
||||||
|
@ -130,6 +131,11 @@ task('pack-webext', 'pack the webextension for deployment', function() {
|
||||||
execSync(`git tag webext-${version}`);
|
execSync(`git tag webext-${version}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Error creating git tag');
|
console.log('Error creating git tag');
|
||||||
|
// Revert changes
|
||||||
|
execSync(`git reset HEAD~`);
|
||||||
|
execSync(`git checkout ./webext/manifest.json`);
|
||||||
|
execSync(`git submodule update`);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
execSync(`git archive -o source.zip HEAD .`);
|
execSync(`git archive -o source.zip HEAD .`);
|
||||||
execSync(`npm run webext`);
|
execSync(`npm run webext`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue