Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #9919 from brave/hotfix--9918
Browse files Browse the repository at this point in the history
Comment unused require for rimraf to fix missing module error
  • Loading branch information
cezaraugusto authored Jul 21, 2017
2 parents 6d54868 + 157fd34 commit 15c72d2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
26 changes: 14 additions & 12 deletions app/browser/reducers/extensionsReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

'use strict'

const electron = require('electron')
const app = electron.app
// const electron = require('electron')
// const app = electron.app

const path = require('path')
const rimraf = require('rimraf')
// const path = require('path')
// TODO @cezaraugusto enable again once we have a GUI to exclude an extension
// const rimraf = require('rimraf')

const extensionState = require('../../common/state/extensionState')
const ExtensionConstants = require('../../common/constants/extensionConstants')
Expand All @@ -18,17 +19,18 @@ const extensionsReducer = (state, action, immutableAction) => {
action = immutableAction || makeImmutable(action)
switch (action.get('actionType')) {
case ExtensionConstants.EXTENSION_UNINSTALLED:
let extensionId = action.get('extensionId').toString()
let extensionPath = path.join(app.getPath('userData'), 'Extensions', extensionId)
// let extensionId = action.get('extensionId').toString()
// let extensionPath = path.join(app.getPath('userData'), 'Extensions', extensionId)

state = extensionState.extensionUninstalled(state, action)
// TODO @cezaraugusto enable again once we have a GUI to exclude an extension
// Remove extension folder
rimraf(extensionPath, err => {
if (err) {
console.log('unable to remove extension', err)
}
console.log(`extension id ${extensionId} removed at: \n ${extensionPath}`)
})
// rimraf(extensionPath, err => {
// if (err) {
// console.log('unable to remove extension', err)
// }
// console.log(`extension id ${extensionId} removed at: \n ${extensionPath}`)
// })
break
}
return state
Expand Down
2 changes: 1 addition & 1 deletion test/unit/app/browser/reducers/extensionsReducerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const extensionState = (extensionId) => Immutable.fromJS({
}
})

describe('extensionsReducer', function () {
describe.skip('extensionsReducer', function () {
let extensionsReducer
const fakeRimraf = sinon.stub()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('ExtensionsTab component', function () {
)
assert.equal(wrapper.find(`[data-extension-id="${passwordManagers.ONE_PASSWORD}"]`).length, 1)
})
it('can be excluded', function () {
it.skip('can be excluded', function () {
const wrapper = mount(
<ExtensionsTab
extensions={extensions(passwordManagers.ONE_PASSWORD, false, true)}
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('ExtensionsTab component', function () {
)
assert.equal(wrapper.find(`[data-extension-id="${passwordManagers.LAST_PASS}"]`).length, 1)
})
it('can be excluded', function () {
it.skip('can be excluded', function () {
const wrapper = mount(
<ExtensionsTab
extensions={extensions(passwordManagers.LAST_PASS, false, true)}
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('ExtensionsTab component', function () {
)
assert.equal(wrapper.find(`[data-extension-id="${passwordManagers.DASHLANE}"]`).length, 1)
})
it('can be excluded', function () {
it.skip('can be excluded', function () {
const wrapper = mount(
<ExtensionsTab
extensions={extensions(passwordManagers.DASHLANE, false, true)}
Expand Down Expand Up @@ -225,7 +225,7 @@ describe('ExtensionsTab component', function () {
)
assert.equal(wrapper.find(`[data-extension-id="${config.PDFJSExtensionId}"]`).length, 1)
})
it('does not show if excluded', function () {
it.skip('does not show if excluded', function () {
const wrapper = mount(
<ExtensionsTab
extensions={extensions(config.PDFJSExtensionId, false, true)}
Expand Down Expand Up @@ -263,7 +263,7 @@ describe('ExtensionsTab component', function () {
)
assert.equal(wrapper.find(`[data-extension-id="${config.PocketExtensionId}"]`).length, 1)
})
it('does not show if excluded', function () {
it.skip('does not show if excluded', function () {
const wrapper = mount(
<ExtensionsTab
extensions={extensions(config.PocketExtensionId, false, true)}
Expand Down Expand Up @@ -301,7 +301,7 @@ describe('ExtensionsTab component', function () {
)
assert.equal(wrapper.find(`[data-extension-id="${config.torrentExtensionId}"]`).length, 1)
})
it('can not be excluded', function () {
it.skip('can not be excluded', function () {
const wrapper = mount(
<ExtensionsTab
extensions={extensions(config.torrentExtensionId, false, true)}
Expand Down

0 comments on commit 15c72d2

Please sign in to comment.