Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSCBasic: deprecate localFileSystem setter #401

Merged
merged 3 commits into from
Apr 15, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Sources/TSCBasic/FileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,19 @@ public class RerootedFileSystemView: FileSystem {
}
}

private var _localFileSystem: any FileSystem = LocalFileSystem()

/// Public access to the local FS proxy.
public var localFileSystem: FileSystem = LocalFileSystem()
public var localFileSystem: any FileSystem {
get {
return _localFileSystem
}

@available(*, deprecated, message: "This global should never be mutable and is supposed to be read-only")
Copy link
Contributor

@tomerd tomerd Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a date here in a comment so we know when this was first deprecated and can delete once enough time has passed

set {
_localFileSystem = newValue
}
}

extension FileSystem {
/// Print the filesystem tree of the given path.
Expand Down