File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ const SvnCommands = require("./commands");
66const Model = require ( "./model" ) ;
77
88function activate ( context ) {
9- console . log ( "svn-scm is now active!" ) ;
10-
119 const disposable = [ ] ;
1210 const svn = new Svn ( ) ;
1311 const model = new Model ( svn ) ;
1412 const contentProvider = new svnContentProvider ( ) ;
1513 const commands = new SvnCommands ( model ) ;
1614
15+ console . log ( "svn-scm is now active!" ) ;
16+
1717 context . subscriptions . push ( disposable ) ;
1818}
1919exports . activate = activate ;
Original file line number Diff line number Diff line change 11const SvnSpawn = require ( "svn-spawn" ) ;
22const vscode = require ( "vscode" ) ;
3+ const cp = require ( "child_process" ) ;
34
45function svn ( cwd = null ) {
56 this . client = new SvnSpawn ( {
67 noAuthCache : true ,
78 cwd : cwd
89 } ) ;
10+
11+ this . isSVNAvailable ( )
12+ . then ( ( ) => { } )
13+ . catch ( ( ) => {
14+ vscode . window . showErrorMessage (
15+ "SVN is not avaialbe in your $PATH. svn-scm is unable to run!"
16+ ) ;
17+ } ) ;
918}
1019
1120svn . prototype . getRepositoryRoot = async function ( path ) {
@@ -21,6 +30,19 @@ svn.prototype.getRepositoryRoot = async function(path) {
2130 }
2231} ;
2332
33+ svn . prototype . isSVNAvailable = async function ( ) {
34+ return new Promise ( ( resolve , reject ) => {
35+ const result = cp . exec ( "svn --version" ) ;
36+
37+ result . stdout . on ( "data" , data => {
38+ resolve ( ) ;
39+ } ) ;
40+ result . stderr . on ( "data" , data => {
41+ reject ( ) ;
42+ } ) ;
43+ } ) ;
44+ } ;
45+
2446svn . prototype . open = function ( repositoryRoot ) {
2547 return new Repository ( this , repositoryRoot ) ;
2648} ;
You can’t perform that action at this time.
0 commit comments