Skip to content

Commit c0f7e87

Browse files
committed
removed os path to avoid confusion
1 parent 4405a67 commit c0f7e87

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/profile/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class Profile {
2323
constructor ({ env, runlog }) {
2424
this.env = env
2525
this.runlog = runlog
26+
// shells and an appropriate config file to add our source line to
27+
// ref: https://en.wikipedia.org/wiki/Unix_shell#Configuration_files
2628
this.SUPPORTED_SHELLS = {
2729
shellFormat: {
2830
// only support shells that support functions
@@ -49,9 +51,6 @@ class Profile {
4951
return this.inHome('.config', ...filepaths)
5052
}
5153

52-
// shells and an appropriate config file to add our source line to
53-
// ref: https://en.wikipedia.org/wiki/Unix_shell#Configuration_files
54-
5554
async installToProfiles () {
5655
return this._updateProfiles({ install: true })
5756
}

test/profile/index.test.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test.beforeEach((t) => {
1515
record: sinon.stub(),
1616
keys: {}
1717
}
18-
sinon.stub(os, 'homedir').returns('/Users/tester')
18+
sinon.stub(os, 'homedir').returns('')
1919
t.context.profile = new Profile({ config, runlog })
2020
})
2121

@@ -28,15 +28,15 @@ test('writes to all shell and power profiles for system with all shells and powe
2828
detectedPowerFormatProfiles
2929
} = await profile._detectProfiles()
3030
t.deepEqual(detectedShellFormatProfiles, [
31-
'/Users/tester/.profile',
32-
'/Users/tester/.kshrc',
33-
'/Users/tester/.zshrc',
34-
'/Users/tester/.zprofile',
35-
'/Users/tester/.bashrc',
36-
'/Users/tester/.bash_profile'
31+
'.profile',
32+
'.kshrc',
33+
'.zshrc',
34+
'.zprofile',
35+
'.bashrc',
36+
'.bash_profile'
3737
])
3838
t.deepEqual(detectedPowerFormatProfiles, [
39-
'/Users/tester/.config/powershell/Microsoft.PowerShell_profile.ps1',
40-
'/Users/tester/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1'
39+
'.config/powershell/Microsoft.PowerShell_profile.ps1',
40+
'Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1'
4141
])
4242
})

0 commit comments

Comments
 (0)