@@ -83,14 +83,18 @@ def appendIJ1plugins(string) {
83
83
return string
84
84
}
85
85
86
- def appendLocalFiles (string ) {
87
- def header = FileUtils . shortenPath(Utils . getBARDir())
88
- string + = " \n ## Local Files ($header )\n "
89
- def dir = new File (Utils . getBARDir())
90
- dir. eachFileRecurse(FileType . FILES ) {
91
- string + = " 1. ${ it.path - dir.path} \n "
86
+ def appendLocalFiles (string , path ) {
87
+ def dir = new File (path)
88
+ files = []
89
+ if (dir. exists()) {
90
+ def header = FileUtils . shortenPath(path)
91
+ string + = " \n ### $header \n "
92
+ dir. eachFileRecurse(FileType . FILES ) {
93
+ files << it. path - dir. path
94
+ string + = " 1. ${ files.last()} \n "
95
+ }
92
96
}
93
- return string
97
+ return new Tuple ( string, files . size())
94
98
}
95
99
96
100
// List resources in BAR jar file
@@ -101,7 +105,9 @@ text = appendResources(text, ["boilerplate", "lib", "script_templates",
101
105
" shared" , " tools" , " tutorials" ])
102
106
103
107
// List user files on local installation
104
- text = appendLocalFiles(text)
108
+ text + = " \n ## Local Files\n "
109
+ text = appendLocalFiles(text, Utils . getBARDir()). get(0 )
110
+ (text, nfiles) = appendLocalFiles(text, Utils . getPluginsBasedBARDir())
105
111
106
112
// Render markdown list
107
113
temp = File . createTempFile(' barlist' , ' .md' )
@@ -110,11 +116,12 @@ displayservice.createDisplay("BAR Files", textservice.asHTML(temp))
110
116
temp. delete()
111
117
112
118
// Check for legacy installation files
113
- if (new File ( Utils . getPluginsBasedBARDir()) . list() ) {
119
+ if (nfiles > 0 ) {
114
120
uiservice. showDialog(" <html><div WIDTH=450>With BAR v1.5 and newer, local files are no "
115
121
+ " longer rooted in the plugins directory. The new, much more convenient directory "
116
122
+ " for your local files is <b>${ Utils.getBARDir()} </b>. You should move any files "
117
123
+ " in the old location to the new one (and safely delete the old directory).<br><br>"
118
124
+ " Old location: <i>${ Utils.getPluginsBasedBARDir()} </i><br>"
119
- + " New location: <i>${ Utils.getBARDir()} </i>" , " Legacy Warning" )
125
+ + " New location: <i>${ Utils.getBARDir()} </i><br>" , " Legacy Warning" )
126
+ Utils . revealFile(Utils . getPluginsBasedBARDir())
120
127
}
0 commit comments