mirror of
https://github.com/SamKirkland/FTP-Deploy-Action.git
synced 2025-08-14 14:05:05 +00:00
more spaghetti at the wall [2]
This commit is contained in:
parent
034d210969
commit
db3b78d8e7
17
dist/index.js
vendored
17
dist/index.js
vendored
@ -659,9 +659,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
const exec = __importStar(__webpack_require__(986));
|
||||
const fs_1 = __importDefault(__webpack_require__(747));
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const userArguments = getUserArguments();
|
||||
@ -669,7 +673,11 @@ function run() {
|
||||
try {
|
||||
yield exec.exec(`mkdir -v -p ${process.env['HOME']}/.ssh`);
|
||||
yield exec.exec(`chmod 700 ${process.env['HOME']}/.ssh`);
|
||||
yield exec.exec(`echo "${userArguments.knownHosts}" > ${process.env['HOME']}/.ssh/known_hosts`);
|
||||
fs_1.default.writeFile(process.env['HOME'] + '/.ssh/known_hosts', userArguments.knownHosts, (err) => {
|
||||
if (err)
|
||||
throw err;
|
||||
console.log('Wrote ' + process.env['HOME'] + '/.ssh/known_hosts');
|
||||
});
|
||||
yield exec.exec(`chmod 755 ${process.env['HOME']}/.ssh/known_hosts`);
|
||||
console.log("✅ Configured known_hosts");
|
||||
}
|
||||
@ -1016,6 +1024,13 @@ module.exports = require("path");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 747:
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = require("fs");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 986:
|
||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||||
|
||||
|
10
src/main.ts
10
src/main.ts
@ -1,5 +1,6 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import fs from 'fs';
|
||||
import { IActionArguments } from './types';
|
||||
|
||||
async function run() {
|
||||
@ -8,7 +9,14 @@ async function run() {
|
||||
try {
|
||||
await exec.exec(`mkdir -v -p ${process.env['HOME']}/.ssh`);
|
||||
await exec.exec(`chmod 700 ${process.env['HOME']}/.ssh`);
|
||||
await exec.exec(`echo "${userArguments.knownHosts}" > ${process.env['HOME']}/.ssh/known_hosts`);
|
||||
fs.writeFile(
|
||||
process.env['HOME'] + '/.ssh/known_hosts',
|
||||
userArguments.knownHosts,
|
||||
(err) => {
|
||||
if (err) throw err;
|
||||
console.log('Wrote ' + process.env['HOME'] + '/.ssh/known_hosts');
|
||||
}
|
||||
);
|
||||
await exec.exec(`chmod 755 ${process.env['HOME']}/.ssh/known_hosts`);
|
||||
console.log("✅ Configured known_hosts");
|
||||
} catch( error ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user