joshmarinacci / ElectronIDE

New web based Arduino IDE
BSD 3-Clause "New" or "Revised" License
246 stars 50 forks source link

old user libs #28

Closed chrwei closed 10 years ago

chrwei commented 10 years ago

I'm not sure what exact end-game for this feature is, but it currently doesn't work at all.

this patch for libraries.js makes it work, if you add a file for each lib you need to use in node_modules/arduinodata/libraries with "oldlib" as the source.

@@ -10,7 +10,7 @@ var libs = null;

  function isInstalled() {
      //console.log('checking if',this.id,'is installed');
 -    if(this.source == 'ide') return true;
 +    if(this.source == 'ide' || this.source == 'oldlib') return true;
      if(fs.existsSync(settings.repos+'/'+this.id)) return true;
      return false;
  }
 @@ -31,6 +31,22 @@ function getIncludePaths(platform) {
          });
          return paths;
      }
 +    if(this.source == 'oldlib') {
 +        var path = settings.userlibs+'/'+this.location;
 +        //console.log("files = ",fs.readdirSync(path));
 +        var paths = [];
 +        paths.push(path);
 +        fs.readdirSync(path).forEach(function(filename) {
 +            if(fs.statSync(path+'/'+filename).isDirectory()) {
 +                if(filename != 'examples') {
 +                    //console.log("found a subdir of files. use it",filename);
 +                    paths.push(path+'/'+filename);
 +                }
 +            }
 +        });
 +        return paths;
 +  }
 +
      if(this.path) {
          return [settings.repos+'/'+this.id+'/'+this.path];
      }
chrwei commented 10 years ago

with the settings file no longer needed, where do we put libraries?

joshmarinacci commented 10 years ago

Auto installed libs will go into a platform specific dir (on Mac it's ~/Libraries/ElectronIDE/downloads). User libs will stay in the standard Arduino location, ex: ~/Documents/Arduino/libraries

chrwei commented 10 years ago

one of the reasons I started using the zip file for arduino IDE on linux is because the packaged versions never seemed to pick up libs in ~/sketchbook/libraries/. I don't think I've tried since 1.0.0 since what I had worked.

I would still like to see a way to override where the sketchbook goes, so it can be in a dropbox or sparkleshare folder directly.

joshmarinacci commented 10 years ago

Oh, you can still set it manually, but by default it will auto-detect.

chrwei commented 10 years ago

so then the settings file is still used? and the .example change should still be made to prevent a pull from overwriting it?

joshmarinacci commented 10 years ago

yes On Jun 23, 2014, at 1:50 PM, Chris Weiss notifications@github.com wrote:

so then the settings file is still used? and the .example change should still be made to prevent a pull from overwriting it?

— Reply to this email directly or view it on GitHub.

joshmarinacci commented 10 years ago

proper user lib support is done.