GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — angular.js/version.js at master · unscene/angular.js

Expand file tree

/

version.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
67 lines (58 loc) · 1.86 KB
/

version.js

Copy path

File metadata and controls

executable file
·
67 lines (58 loc) · 1.86 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/usr/bin/env node
var FILE = 'version.yaml';
var fs = require('fs');
var optimist = require('optimist');
optimist
.usage('Manage ' + FILE + '.\nUsage: $0 [options]')
.describe('remove-snapshot', 'Remove -snapshot suffix.')
.describe('minor-bump', 'Bump minor version one step.')
.describe('minor-next', 'Return next minor version.')
.describe('current', 'Return current verion')
.describe('help', 'Show usage');
var bumpMinor = function(version) {
var parts = version.split('.');
var last = parts.pop();
var rc = last.match(/(\d*)rc(\d*)/);
if (rc) {
parts.push(rc[1] + 'rc' + (parseInt(rc[2], 10) + 1));
} else {
parts.push('' + (parseInt(last, 10) + 1));
}
return parts.join('.');
};
fs.readFile(FILE, 'utf8', function(err, content) {
var version = content.match(/version\:\s([^\-\n]*)/)[1];
var args = optimist.argv;
if (args['remove-snapshot']) {
fs.writeFile(FILE, content.replace('-snapshot', ''), function(err) {
if (!err) {
console.log('Version updated (removed -snapshot).');
process.exit(0);
} else {
console.error('Version update failed.');
process.exit(1);
}
});
} else if (args['minor-next']) {
process.stdout.write(bumpMinor(version) + '\n');
process.exit(0);
} else if (args['current']) {
process.stdout.write(version + '\n');
process.exit(0);
} else if (args['minor-bump']) {
var bumped = bumpMinor(version);
if (!content.match(/\-snapshot/)) bumped += '-snapshot';
fs.writeFile(FILE, content.replace(version, bumped), function(err) {
if (!err) {
console.log('Version updated (bumped to ' + bumped + ').');
process.exit(0);
} else {
console.error('Version update failed.');
process.exit(1);
}
});
} else {
console.log(optimist.help());
process.exit(args['help'] ? 0 : 1);
}
});
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.