mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-01-24 20:12:15 +01:00
Feat: Support macOS and Windows, migrate JavaScript to TypeScript (#32)
- Support macOS and Windows (Close #24 ) - Refactoring - Error handling - TypeScript - Prettier (Close #29 ) - GHA: Add upload-artifact step for test coverage - deps: Install husky
This commit is contained in:
18
lib/get-os.js
Normal file
18
lib/get-os.js
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function getOS(platform) {
|
||||
if (platform === 'linux') {
|
||||
return 'Linux';
|
||||
}
|
||||
else if (platform === 'darwin') {
|
||||
return 'macOS';
|
||||
}
|
||||
else if (platform === 'win32') {
|
||||
return 'Windows';
|
||||
// throw new Error("Windows is not supported");
|
||||
}
|
||||
else {
|
||||
throw new Error(`${platform} is not supported`);
|
||||
}
|
||||
}
|
||||
exports.default = getOS;
|
||||
Reference in New Issue
Block a user