mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-20 22:44:11 +00:00
Fix Bundle Path logic
This commit is contained in:
@@ -137,7 +137,7 @@ class ServerProfileManager: NSObject {
|
||||
//读取example文件,删掉configs里面的配置,再用NSDictionary填充到configs里面
|
||||
let fileManager = FileManager.default
|
||||
|
||||
let filePath:String = Bundle.main.bundlePath + "/Contents/Resources/example-gui-config.json"
|
||||
let filePath:String = Bundle.main.path(forResource: "example-gui-config", ofType: "json")!
|
||||
let data = fileManager.contents(atPath: filePath)
|
||||
let readString = NSString(data: data!, encoding: String.Encoding.utf8.rawValue)!
|
||||
let readStringData = readString.data(using: String.Encoding.utf8.rawValue)
|
||||
@@ -196,7 +196,7 @@ class ServerProfileManager: NSObject {
|
||||
|
||||
class func showExampleConfigFile() {
|
||||
//copy file to ~/Downloads folder
|
||||
let filePath:String = Bundle.main.bundlePath + "/Contents/Resources/example-gui-config.json"
|
||||
let filePath:String = Bundle.main.path(forResource: "example-gui-config", ofType: "json")!
|
||||
let fileMgr = FileManager.default
|
||||
let dataPath = NSHomeDirectory() + "/Downloads"
|
||||
let destPath = dataPath + "/example-gui-config.json"
|
||||
|
||||
Reference in New Issue
Block a user