1
0
Fork 0
mirror of https://github.com/shimataro/ssh-key-action.git synced 2025-06-19 22:52:10 +10:00

* use default import (#108)

This commit is contained in:
shimataro 2020-02-08 17:12:21 +09:00 committed by GitHub
parent bd25955fab
commit 35971977d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 9 deletions

View file

@ -1,4 +1,7 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
@ -7,8 +10,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const core = __importStar(require("@actions/core"));
/**
* main function
@ -45,15 +48,15 @@ function main() {
];
// create ".ssh" directory
const home = getHomeDirectory();
const dirName = path.resolve(home, ".ssh");
fs.mkdirSync(dirName, {
const dirName = path_1.default.resolve(home, ".ssh");
fs_1.default.mkdirSync(dirName, {
recursive: true,
mode: 0o700,
});
// create files
for (const file of files) {
const fileName = path.join(dirName, file.name);
fs.writeFileSync(fileName, file.contents, file.options);
const fileName = path_1.default.join(dirName, file.name);
fs_1.default.writeFileSync(fileName, file.contents, file.options);
}
console.log(`SSH key has been stored to ${dirName} successfully.`);
}