Skip to content

Commit

Permalink
Add permissions on windows to delete our temp files
Browse files Browse the repository at this point in the history
  • Loading branch information
gangelo committed May 21, 2024
1 parent 4f483cb commit 178d2d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,16 @@ jobs:
- name: Install dependencies
run: bundle install

- name: Grant delete permissions on Windows
if: matrix.os == 'windows-latest'
run: icacls D:\a\_temp /grant Everyone:F /T
# run: |
# $path = "D:/a/_temp"
# $acl = Get-Acl $path
# $permission = "Everyone", "FullControl", "ContainerInherit, ObjectInherit", "None", "Allow"
# $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
# $acl.SetAccessRule($accessRule)
# Set-Acl $path $acl

- name: Run tests
run: bundle exec rake
4 changes: 3 additions & 1 deletion spec/dsu/crud/json_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def to_h
end

before do
File.delete(temp_file)
FileUtils.chmod(0o644, temp_file.path)
temp_file.close
File.delete(temp_file.path)
end

let(:input_file) { 'spec/fixtures/files/json_file.json' }
Expand Down

0 comments on commit 178d2d9

Please sign in to comment.