Skip to content

Commit 95731ab

Browse files
committed
fixed gist
1 parent f2f8847 commit 95731ab

3 files changed

Lines changed: 4 additions & 24 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "acode-plugin-github",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Github plugin for acode editor",
55
"main": "dist/main.js",
66
"repository": "https://github.com/deadlyjack/acode-plugin-github.git",

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "acode.plugin.github",
33
"name": "Github",
44
"main": "dist/main.js",
5-
"version": "1.2.1",
5+
"version": "1.3.0",
66
"readme": "readme.md",
77
"icon": "icon.png",
88
"minVersionCode": 292,

src/githubFs.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ export default function githubFs(token, settings) {
131131
repo = gh.getRepo(user, repoName);
132132
}
133133

134-
const move = async (dest) => {
135-
const newUrl = githubFs.constructUrl('repo', user, repoName, dest, branch);
136-
if (dest === path) return newUrl;
137-
if (dest.startsWith('/')) dest = dest.slice(1);
138-
await repo.move(branch, path, dest);
139-
return newUrl;
140-
}
141-
142134
return {
143135
async lsDir() {
144136
await init();
@@ -334,21 +326,9 @@ export default function githubFs(token, settings) {
334326
async lsDir() {
335327
throw new Error('Not supported');
336328
},
337-
async readFile(encoding) {
329+
async readFile() {
338330
await init();
339-
let { content: data } = await getFile();
340-
const textEncoder = new TextEncoder();
341-
data = textEncoder.encode(file.content);
342-
343-
if (encoding) {
344-
if (encodings?.decode) {
345-
const decoded = await encodings.decode(data, encoding);
346-
if (decoded) return decoded;
347-
}
348-
349-
return helpers.decodeText(data, encoding);
350-
}
351-
331+
const { content: data } = await getFile();
352332
return data;
353333
},
354334
async writeFile(data, encoding) {

0 commit comments

Comments
 (0)