Rollback folder check

This commit is contained in:
James Ives 2020-06-06 13:49:39 -04:00
parent a108ee7921
commit 5e3a0374ac
2 changed files with 0 additions and 30 deletions

View File

@ -146,29 +146,6 @@ describe('git', () => {
} }
}) })
it('should fail if the folder does not exist in the tree', async () => {
Object.assign(action, {
repositoryPath: 'JamesIves/github-pages-deploy-action',
gitHubToken: '123',
branch: 'branch',
pusher: {
name: 'asd',
email: 'as@cat'
},
folder: 'notARealFolder',
ssh: true
})
try {
await init(action)
} catch (e) {
expect(execute).toBeCalledTimes(0)
expect(e.message).toMatch(
`There was an error initializing the repository: The notARealFolder directory you're trying to deploy doesn't exist. ❗ ❌`
)
}
})
it('should fail if there is no provided repository path', async () => { it('should fail if there is no provided repository path', async () => {
Object.assign(action, { Object.assign(action, {
repositoryPath: null, repositoryPath: null,

View File

@ -1,5 +1,4 @@
import {isDebug} from '@actions/core' import {isDebug} from '@actions/core'
import {existsSync} from 'fs'
import {ActionInterface} from './constants' import {ActionInterface} from './constants'
/* Utility function that checks to see if a value is undefined or not. */ /* Utility function that checks to see if a value is undefined or not. */
@ -51,12 +50,6 @@ export const hasRequiredParameters = (action: ActionInterface): void => {
"Incorrectly formatted build folder. The deployment folder cannot be prefixed with '/' or './'. Instead reference the folder name directly." "Incorrectly formatted build folder. The deployment folder cannot be prefixed with '/' or './'. Instead reference the folder name directly."
) )
} }
if (!existsSync(action.folder) && action.folder !== action.root) {
throw new Error(
`The ${action.folder} directory you're trying to deploy doesn't exist. ❗`
)
}
} }
/* Suppresses sensitive information from being exposed in error messages. */ /* Suppresses sensitive information from being exposed in error messages. */