|
|
@ -274,7 +274,6 @@ const buildGistPayload = (selectedFiles: { key: string, type: 'file' | 'folder', |
|
|
|
export const publishFilesToGist = (arrayOfSelectedFiles: any) => { |
|
|
|
export const publishFilesToGist = (arrayOfSelectedFiles: any) => { |
|
|
|
const gistPayload = buildGistPayload(arrayOfSelectedFiles) |
|
|
|
const gistPayload = buildGistPayload(arrayOfSelectedFiles) |
|
|
|
if (!gistPayload) { |
|
|
|
if (!gistPayload) { |
|
|
|
console.error('No files to publish'); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('primed and ready', gistPayload) |
|
|
|
console.log('primed and ready', gistPayload) |
|
|
@ -296,7 +295,6 @@ export const publishFilesToGist = (arrayOfSelectedFiles: any) => { |
|
|
|
public: true, |
|
|
|
public: true, |
|
|
|
files: gistPayload |
|
|
|
files: gistPayload |
|
|
|
}, (error, result) => { |
|
|
|
}, (error, result) => { |
|
|
|
console.log('what comes back from gist creation', { error, result }) |
|
|
|
|
|
|
|
handleGistResponse(error, result) |
|
|
|
handleGistResponse(error, result) |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log('publishFilesToGistIsDone') |
|
|
|
console.log('publishFilesToGistIsDone') |
|
|
@ -318,7 +316,6 @@ export const publishToGist = async (path?: string) => { |
|
|
|
id = await plugin.call('filePanel', 'isGist') |
|
|
|
id = await plugin.call('filePanel', 'isGist') |
|
|
|
} |
|
|
|
} |
|
|
|
const packaged = await packageGistFiles(folder) |
|
|
|
const packaged = await packageGistFiles(folder) |
|
|
|
console.log('packed files', packaged) |
|
|
|
|
|
|
|
// check for token
|
|
|
|
// check for token
|
|
|
|
const config = plugin.registry.get('config').api |
|
|
|
const config = plugin.registry.get('config').api |
|
|
|
const accessToken = config.get('settings/gist-access-token') |
|
|
|
const accessToken = config.get('settings/gist-access-token') |
|
|
@ -370,7 +367,6 @@ export const publishToGist = async (path?: string) => { |
|
|
|
public: true, |
|
|
|
public: true, |
|
|
|
files: packaged |
|
|
|
files: packaged |
|
|
|
}, (error, result) => { |
|
|
|
}, (error, result) => { |
|
|
|
console.log('what comes back from gist creation', { error, result }) |
|
|
|
|
|
|
|
handleGistResponse(error, result) |
|
|
|
handleGistResponse(error, result) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -585,7 +581,6 @@ export const restoreBackupZip = async () => { |
|
|
|
const packageGistFiles = async (directory) => { |
|
|
|
const packageGistFiles = async (directory) => { |
|
|
|
const workspaceProvider = plugin.fileProviders.workspace |
|
|
|
const workspaceProvider = plugin.fileProviders.workspace |
|
|
|
const isFile = await workspaceProvider.isFile(directory) |
|
|
|
const isFile = await workspaceProvider.isFile(directory) |
|
|
|
console.log('here is the state of things in packageGistFiles', { directory, isFile }) |
|
|
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
const ret = {} |
|
|
|
const ret = {} |
|
|
|
|
|
|
|
|
|
|
|