Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix launch error by disabling db access in command line

  • Loading branch information...
commit c544aa29f1c379a22ca3e131981f183ccaf03c29 1 parent 0ae2d72
@Aqua-Ye Aqua-Ye authored
View
12 src/config.opa
@@ -8,8 +8,8 @@ module Config {
// TODO: abstract away this pattern
server host =
- _ = CommandLine.filter(
- { init: void
+ state = CommandLine.filter(
+ { init: none
, parsers: [{ CommandLine.default_parser with
names: ["--host"],
param_doc: "HOST",
@@ -18,8 +18,8 @@ module Config {
parser {
case host=(.*) :
{
- /host <- Text.to_string(host)
- {no_params: state}
+ // /host <- Text.to_string(host)
+ {no_params: some(Text.to_string(host))}
}
}
}
@@ -28,8 +28,8 @@ module Config {
, title: "General options"
}
)
- match (?/host) {
- case {some: host}: host
+ match (state) {
+ case {some: s}: s
default:
Log.error("webshell[config]", "Cannot read host configuration
Please re-run your application with: --host option")
View
11 src/dropbox.opa
@@ -16,8 +16,8 @@ type Dropbox.status = {no_credentials}
module DropboxConnect {
private server config =
- _ = CommandLine.filter(
- { init: void
+ state = CommandLine.filter(
+ { init: none
, parsers: [{ CommandLine.default_parser with
names: ["--dropbox-config"],
param_doc: "APP_KEY,APP_SECRET",
@@ -26,8 +26,9 @@ module DropboxConnect {
parser {
case app_key=Rule.alphanum_string [,] app_secret=Rule.alphanum_string :
{
- /dropbox_config <- ~{app_key, app_secret}
- {no_params: state}
+ db_config = ~{app_key, app_secret}
+ // /dropbox_config <- db_config
+ {no_params: some(db_config)}
}
}
}
@@ -36,7 +37,7 @@ module DropboxConnect {
, title: "Dropbox configuration"
}
)
- match (?/dropbox_config) {
+ match (state) {
case {some: config}: config
default:
Log.error("webshell[config]", "Cannot read Dropbox configuration (application key and/or secret key)
View
11 src/facebook.opa
@@ -20,8 +20,8 @@ module FacebookConnect
{
server config =
- _ = CommandLine.filter(
- { init: void
+ state = CommandLine.filter(
+ { init: none
, parsers: [{ CommandLine.default_parser with
names: ["--fb-config"],
param_doc: "APP_ID,APP_SECRET",
@@ -30,8 +30,9 @@ module FacebookConnect
parser {
case app_id=Rule.alphanum_string [,] app_secret=Rule.alphanum_string:
{
- /facebook_config <- {~app_id, api_key: app_id, ~app_secret};
- {no_params: state}
+ fb_config = {~app_id, api_key: app_id, ~app_secret};
+ // /facebook_config <- fb_config
+ {no_params: some(fb_config)}
}
}
}
@@ -40,7 +41,7 @@ module FacebookConnect
, title: "Facebook configuration"
}
)
- match (?/facebook_config) {
+ match (state) {
case {some: config}: config
default:
Log.error("webshell[config]", "Cannot read Facebook configuration (application id and/or secret key)
View
10 src/search.opa
@@ -45,8 +45,8 @@ module SearchParser {
module Search {
auth =
- _ = CommandLine.filter(
- { init: void
+ state = CommandLine.filter(
+ { init: none
, parsers: [{ CommandLine.default_parser with
names: ["--blekko-config"],
param_doc: "AUTH_KEY",
@@ -55,8 +55,8 @@ module Search {
parser {
case auth_key=Rule.alphanum_string :
{
- /blekko_auth_key <- auth_key
- {no_params: state}
+ // /blekko_auth_key <- auth_key
+ {no_params: some(auth_key)}
}
}
}
@@ -65,7 +65,7 @@ module Search {
, title: "Blekko configuration"
}
)
- match (?/blekko_auth_key) {
+ match (state) {
case {some: key}: key
default:
Log.error("webshell[config]", "Cannot read Blekko configuration (auth_key)
View
17 src/twitter.opa
@@ -13,9 +13,9 @@ type Twitter.status = {no_credentials}
module TwitterConnect
{
- server config =
- _ = CommandLine.filter(
- { init: void
+ config =
+ state = CommandLine.filter(
+ { init: none
, parsers: [{ CommandLine.default_parser with
names: ["--twitter-config"],
param_doc: "APP_KEY,APP_SECRET",
@@ -24,10 +24,11 @@ module TwitterConnect
parser {
case app_key=Rule.alphanum_string [,] app_secret=Rule.alphanum_string:
{
- /twitter_config <- { consumer_key: app_key,
- consumer_secret: app_secret
- }
- {no_params: state}
+ tw_config = { consumer_key: app_key,
+ consumer_secret: app_secret
+ }
+ // /twitter_config <- tw_config
+ {no_params: some(tw_config)}
}
}
}
@@ -36,7 +37,7 @@ module TwitterConnect
, title: "Twitter configuration"
}
)
- match (?/twitter_config) {
+ match (state) {
case {some: config}: config
default:
Log.error("webshell[config]", "Cannot read Twitter configuration (application key and/or secret key)
Please sign in to comment.
Something went wrong with that request. Please try again.