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

improvement to keep the configuration file in a separated user repo #12

Open
crguezl opened this issue May 29, 2022 · 1 comment
Open
Assignees

Comments

@crguezl
Copy link

crguezl commented May 29, 2022

Improvement to keep the configuration file in a separated user repo

The current code in file config.ts is to check if the file exist and otherwise to create a minimal file from the template:

export let config: configType;
if (!fs.existsSync(configPath)) {
  console.log("No config file detected");
  console.log("Creating new config...");
  fs.copyFileSync(__dirname + "/../utils/config.template.json", configPath, fs.constants.COPYFILE_EXCL);
}

Alternative to explore:

  1. if (!fs.existsSync(configPath)) {
    1. try to see if there is a repo github-user/gh-edu-profile in GitHub and if so
    2. get the config file config.json from there by cloning the repo,
    3. make a symbolic link to the config file
  2. otherwise, if there is no gh-edu-profile repo at GH
    1. make a folder gh-edu-profile in the extension folder
    2. copy the minimal template to gh-edu-profile
    3. make a symbolic link to the just created config file
    4. create the github repo github-user/gh-edu-profile and push the config file

It is a lot of work

@crguezl crguezl self-assigned this May 29, 2022
@GGCristo
Copy link
Collaborator

GGCristo commented Jun 13, 2022

b8aa608

  • Update config file in remote using update command
    • Don't update installed commands because that is local information
  • Create fetch in update or reset command to fetch information
  • Remove tmp dir on error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants