Add support to v1 to connect to GHES (#69)

* Bumping actions/github to 2.2.0 for GHES

* Husky commit correct node modules
This commit is contained in:
PJ Quirk
2020-05-15 15:25:57 -04:00
committed by GitHub
parent c201d45ef4
commit 0649bd8119
7893 changed files with 2232817 additions and 49009 deletions

View File

@@ -26,13 +26,21 @@ const windowsRelease = release => {
const ver = (version || [])[0];
// Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
// Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
// If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
// then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
// If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
// If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
// If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
const year = (stdout.match(/2008|2012|2016/) || [])[0];
let stdout;
try {
stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
} catch (_) {
stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
}
const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
if (year) {
return `Server ${year}`;
}

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@@ -1,8 +1,8 @@
{
"_from": "windows-release@^3.1.0",
"_id": "windows-release@3.2.0",
"_id": "windows-release@3.3.0",
"_inBundle": false,
"_integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==",
"_integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==",
"_location": "/windows-release",
"_phantomChildren": {},
"_requested": {
@@ -18,14 +18,14 @@
"_requiredBy": [
"/os-name"
],
"_resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz",
"_shasum": "8122dad5afc303d833422380680a79cdfa91785f",
"_resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz",
"_shasum": "dce167e9f8be733f21c849ebd4d03fe66b29b9f0",
"_spec": "windows-release@^3.1.0",
"_where": "Z:\\Dreamlifter\\stale\\node_modules\\os-name",
"_where": "/Users/pjquirk/Source/GitHub/actions/stale/node_modules/os-name",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/windows-release/issues"
@@ -48,6 +48,7 @@
"index.js",
"index.d.ts"
],
"funding": "https://github.com/sponsors/sindresorhus",
"homepage": "https://github.com/sindresorhus/windows-release#readme",
"keywords": [
"os",
@@ -71,5 +72,5 @@
"scripts": {
"test": "xo && ava && tsd"
},
"version": "3.2.0"
"version": "3.3.0"
}

View File

@@ -2,14 +2,12 @@
> Get the name of a Windows version from the release number: `5.1.2600` → `XP`
## Install
```
$ npm install windows-release
```
## Usage
```js
@@ -31,10 +29,9 @@ windowsRelease('4.9.3000');
//=> 'ME'
```
## API
### windowsRelease([release])
### windowsRelease(release?)
#### release
@@ -44,13 +41,19 @@ By default, the current OS is used, but you can supply a custom release number,
Note: Most Windows Server versions cannot be detected based on the release number alone. There is runtime detection in place to work around this, but it will only be used if no argument is supplied, or the supplied argument matches `os.release()`.
## Related
- [os-name](https://github.com/sindresorhus/os-name) - Get the name of the current operating system
- [macos-release](https://github.com/sindresorhus/macos-release) - Get the name and version of a macOS release from the Darwin version
---
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-windows-release?utm_source=npm-windows-release&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>