From 6edc4c976449147551137b19eb7bc092d9d129ec Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Thu, 6 Feb 2020 01:38:12 +0900 Subject: [PATCH] fix: copy directories #89 --- package-lock.json | 17 ++++++----------- package.json | 1 - src/git-utils.ts | 6 +++--- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index c28edcb58..b0db30b87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,15 +27,6 @@ "@octokit/rest": "^16.15.0" } }, - "@actions/glob": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.0.tgz", - "integrity": "sha512-lx8SzyQ2FE9+UUvjqY1f28QbTJv+w8qP7kHHbfQRhphrlcx0Mdmm1tZdGJzfxv1jxREa/sLW4Oy8CbGQKCJySA==", - "requires": { - "@actions/core": "^1.2.0", - "minimatch": "^3.0.4" - } - }, "@actions/http-client": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.6.tgz", @@ -1136,7 +1127,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -1217,6 +1209,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1578,7 +1571,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "2.0.0", @@ -5265,6 +5259,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } diff --git a/package.json b/package.json index 44ead38bb..f33a7c951 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "@actions/core": "^1.2.2", "@actions/exec": "^1.0.3", "@actions/github": "^2.1.0", - "@actions/glob": "^0.1.0", "@actions/io": "^1.0.2" }, "devDependencies": { diff --git a/src/git-utils.ts b/src/git-utils.ts index 1ad2f48d3..f09688c90 100644 --- a/src/git-utils.ts +++ b/src/git-utils.ts @@ -2,8 +2,8 @@ import * as core from '@actions/core'; import * as exec from '@actions/exec'; import * as github from '@actions/github'; import * as io from '@actions/io'; -import * as glob from '@actions/glob'; import path from 'path'; +import fs from 'fs'; import {Inputs, CmdResult} from './interfaces'; import {getHomeDir} from './utils'; @@ -24,8 +24,8 @@ export async function copyAssets( workDir: string ): Promise { const copyOpts = {recursive: true, force: false}; - const globber = await glob.create(`${publishDir}/*`); - for await (const file of globber.globGenerator()) { + const files = fs.readdirSync(publishDir); + for await (const file of files) { if (file.endsWith('.git') || file.endsWith('.github')) { continue; }