public
void
processInitFiles(CliSessionState ss)
throws
IOException {
boolean
saveSilent = ss. getIsSilent();
ss.setIsSilent(
true
);
for
(String initFile : ss. initFiles) {
int
rc = processFile(initFile);
if
(rc !=
0
) {
System. exit(rc);
}
}
if
(ss. initFiles.size() ==
0
) {
if
(System.getenv(
"HIVE_HOME"
) !=
null
) {
String hivercDefault = System. getenv(
"HIVE_HOME"
) + File. separator +
"bin"
+ File.separator + HIVERCFILE;
if
(
new
File(hivercDefault).exists()) {
int
rc = processFile(hivercDefault);
if
(rc !=
0
) {
System. exit(rc);
}
console.printError(
"Putting the global hiverc in "
+
"$HIVE_HOME/bin/.hiverc is deprecated. Please "
+
"use $HIVE_CONF_DIR/.hiverc instead."
);
}
}
if
(System.getenv(
"HIVE_CONF_DIR"
) !=
null
) {
String hivercDefault = System. getenv(
"HIVE_CONF_DIR"
) + File. separator
+ HIVERCFILE;
if
(
new
File(hivercDefault).exists()) {
int
rc = processFile(hivercDefault);
if
(rc !=
0
) {
System. exit(rc);
}
}
}
if
(System.getProperty(
"user.home"
) !=
null
) {
String hivercUser = System. getProperty(
"user.home"
) + File. separator +
HIVERCFILE;
if
(
new
File(hivercUser).exists()) {
int
rc = processFile(hivercUser);
if
(rc !=
0
) {
System. exit(rc);
}
}
}
}
ss.setIsSilent(saveSilent);
}