Commit 611655e3 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

By default, the script will run with the latest guiHive version, which ships msg.pm

Don't need to set PERL5LIB at the beginning since it is set each time we run a script
parent 86d3ae5c
=pod
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
package msg;
use strict;
use warnings;
use Data::Dumper;
use JSON;
sub new {
my ($class) = @_;
my $self = bless({}, $class);
$self->init();
return $self;
}
sub init {
my ($self) = @_;
$self->err_msg("");
$self->status("ok");
$self->out_msg("");
return;
}
sub err_msg {
my ($self, $msg) = @_;
$self->{err_msg} = $msg if (defined $msg);
return $self->{err_msg};
}
sub status {
my ($self, $status) = @_;
$self->{status} = $status if (defined $status);
return $self->{status};
}
sub out_msg {
my ($self, $out_msg) = @_;
$self->{out_msg} = $out_msg if (defined $out_msg);
return $self->{out_msg};
}
sub TO_JSON {
my ($self) = @_;
return { %$self };
}
sub toJSON {
my ($self) = @_;
return JSON->
new->
indent(0)->
allow_blessed->
convert_blessed->encode($self);
}
1;
......@@ -23,12 +23,11 @@
use strict;
use warnings;
## The servers should have already set the PERL5LIB to point to the latest hive API in versions
## The server should have already set the PERL5LIB to point to the latest hive API in versions/
use Bio::EnsEMBL::Hive::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Hive::Utils::URL;
use JSON;
use lib ("../lib");
use msg;
my $response = msg->new();
......
......@@ -191,13 +191,6 @@ func setEnvVar() error {
}
debug("PROJECT_DIRECTORY: %s\n", os.Getenv("GUIHIVE_PROJECTDIR"))
// PER5LIB
newPerl5Lib := addPerl5Lib(path.Clean(projectDirectory + "/scripts/lib"))
err = setPerl5Lib(newPerl5Lib)
if (err != nil) {
return err
}
return nil
}
......@@ -211,16 +204,6 @@ func addPerl5Lib (newDir string) string {
return perl5lib
}
func setPerl5Lib (perl5lib string) error {
err := os.Setenv("PERL5LIB", perl5lib)
if err != nil {
return err
}
debug("PERL5LIB: %s\n", os.Getenv("PERL5LIB"))
return nil
}
func main() {
// Fix environmental variables
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment