Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mo9a7i committed Aug 26, 2023
1 parent b2157ee commit 15661a8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @6degrees/source-code-spitter

## 2.0.3

### Patch Changes

- Removing open and github stuff

## 2.0.0

### Major Changes
Expand Down
44 changes: 22 additions & 22 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const fs = require('fs-extra');
const path = require('path');
const ignore = require('ignore');
const chalk = require('chalk');
const { Octokit } = require('@octokit/rest');
// const { Octokit } = require('@octokit/rest');

const open = require('open');
// const open = require('open');
const init = require('./utils/init');
const cli = require('./utils/cli');
const log = require('./utils/log');
const DEFAULT_IGNORED_FILES = require('./utils/ignore-config');

const clientId = 'f7ec24587e812f6ce928';
// const clientId = 'f7ec24587e812f6ce928';

const { input, flags } = cli;
const { clear, debug, include, exclude } = flags;
Expand Down Expand Up @@ -77,25 +77,25 @@ const parseIgnoreFiles = () => {
};

// Todo: Function to create a GitHub Gist
const createGist = async (code) => {
open(`https://github.com/login/oauth/authorize?client_id=${clientId}&scope=gist`);

const octokit = new Octokit({
auth: 'YOUR_PERSONAL_ACCESS_TOKEN', // You'll need to handle authentication
});

const response = await octokit.gists.create({
description: 'Extracted code snippet',
public: true,
files: {
'snippet.txt': {
content: code
}
}
});

return response.data.html_url;
};
// const createGist = async (code) => {
// open(`https://github.com/login/oauth/authorize?client_id=${clientId}&scope=gist`);

// const octokit = new Octokit({
// auth: 'YOUR_PERSONAL_ACCESS_TOKEN', // You'll need to handle authentication
// });

// const response = await octokit.gists.create({
// description: 'Extracted code snippet',
// public: true,
// files: {
// 'snippet.txt': {
// content: code
// }
// }
// });

// return response.data.html_url;
// };

// Function to generate a dump of source code from a directory
const generateSourceCodeDump = directory => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@6degrees/source-code-spitter",
"description": "A command-line tool to extract and organize source code snippets from projects, enabling easy sharing and collaboration.",
"version": "2.0.2",
"version": "2.0.3",
"license": "MIT",
"bin": {
"source-code-spitter": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion utils/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const flags = {
alias: 'g',
desc: 'Share the extracted code as a GitHub Gist'
},

};

const commands = {
Expand Down

0 comments on commit 15661a8

Please sign in to comment.